зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1670316 - Undo full zoom in ShouldBlockCustomCursor. r=hiro
Full zoom in the child process won't be applied to the cursor rect, so undo it before checking to consider the actual rect that will be used. Differential Revision: https://phabricator.services.mozilla.com/D93329
This commit is contained in:
Родитель
ba79cac2a8
Коммит
c5baeaba64
|
@ -3899,9 +3899,13 @@ static bool ShouldBlockCustomCursor(nsPresContext* aPresContext,
|
|||
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
||||
aEvent, RelativeTo{topLevel->PresShell()->GetRootFrame()});
|
||||
|
||||
nsSize size(CSSPixel::ToAppUnits(width), CSSPixel::ToAppUnits(height));
|
||||
nsPoint hotspot(CSSPixel::ToAppUnits(aCursor.mHotspot.x),
|
||||
CSSPixel::ToAppUnits(aCursor.mHotspot.y));
|
||||
// The cursor size won't be affected by our full zoom in the parent process,
|
||||
// so undo that before checking the rect.
|
||||
float zoom = topLevel->GetFullZoom();
|
||||
nsSize size(CSSPixel::ToAppUnits(width / zoom),
|
||||
CSSPixel::ToAppUnits(height / zoom));
|
||||
nsPoint hotspot(CSSPixel::ToAppUnits(aCursor.mHotspot.x / zoom),
|
||||
CSSPixel::ToAppUnits(aCursor.mHotspot.y / zoom));
|
||||
|
||||
nsRect cursorRect(point - hotspot, size);
|
||||
return !topLevel->GetVisibleArea().Contains(cursorRect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче