mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 563878. Part 16. Switch nsMenuPopupFrame::SetPopupPosition to using the new API to convert app units. r=mats
This commit is contained in:
parent
20d255fcc2
commit
d421bb8373
@ -996,12 +996,10 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, PRBool aIsMove)
|
|||||||
|
|
||||||
// the anchor may be in a different document with a different scale,
|
// the anchor may be in a different document with a different scale,
|
||||||
// so adjust the size so that it is in the app units of the popup instead
|
// so adjust the size so that it is in the app units of the popup instead
|
||||||
// of the anchor. This is done by converting to device pixels by dividing
|
// of the anchor.
|
||||||
// by the anchor's app units per device pixel and then converting back to
|
parentRect = parentRect.ConvertAppUnitsRoundOut(
|
||||||
// app units by multiplying by the popup's app units per device pixel.
|
aAnchorFrame->PresContext()->AppUnitsPerDevPixel(),
|
||||||
float adj = float(presContext->AppUnitsPerDevPixel()) /
|
presContext->AppUnitsPerDevPixel());
|
||||||
aAnchorFrame->PresContext()->AppUnitsPerDevPixel();
|
|
||||||
parentRect.ScaleRoundOut(adj);
|
|
||||||
|
|
||||||
// Set the popup's size to the preferred size. Below, this size will be
|
// Set the popup's size to the preferred size. Below, this size will be
|
||||||
// adjusted to fit on the screen or within the content area. If the anchor
|
// adjusted to fit on the screen or within the content area. If the anchor
|
||||||
|
Loading…
Reference in New Issue
Block a user