зеркало из https://github.com/mozilla/gecko-dev.git
Bug 961431. Round the final screen position of the popup to pixels, not the offset between it's view and parent view. r=enndeakin
This commit is contained in:
Родитель
28de2fa1e5
Коммит
fb86cc7ef4
|
@ -1334,14 +1334,15 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, bool aIsMove, bool aS
|
|||
"Popup is offscreen");
|
||||
}
|
||||
|
||||
// snap the popup's position in screen coordinates to device pixels,
|
||||
// see bug 622507, bug 961431
|
||||
screenPoint.x = presContext->RoundAppUnitsToNearestDevPixels(screenPoint.x);
|
||||
screenPoint.y = presContext->RoundAppUnitsToNearestDevPixels(screenPoint.y);
|
||||
|
||||
// determine the x and y position of the view by subtracting the desired
|
||||
// screen position from the screen position of the root frame.
|
||||
nsPoint viewPoint = screenPoint - rootScreenRect.TopLeft();
|
||||
|
||||
// snap the view's position to device pixels, see bug 622507
|
||||
viewPoint.x = presContext->RoundAppUnitsToNearestDevPixels(viewPoint.x);
|
||||
viewPoint.y = presContext->RoundAppUnitsToNearestDevPixels(viewPoint.y);
|
||||
|
||||
nsView* view = GetView();
|
||||
NS_ASSERTION(view, "popup with no view");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче