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:
Timothy Nikkel 2014-03-28 20:00:27 -05:00
parent d010bcac24
commit 1172e26981

View File

@ -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");