Bug 563878. Part 16. Switch nsMenuPopupFrame::SetPopupPosition to using the new API to convert app units. r=mats

This commit is contained in:
Timothy Nikkel 2010-07-18 21:23:48 -05:00
parent 20d255fcc2
commit d421bb8373

View File

@ -996,12 +996,10 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, PRBool aIsMove)
// 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
// of the anchor. This is done by converting to device pixels by dividing
// by the anchor's app units per device pixel and then converting back to
// app units by multiplying by the popup's app units per device pixel.
float adj = float(presContext->AppUnitsPerDevPixel()) /
aAnchorFrame->PresContext()->AppUnitsPerDevPixel();
parentRect.ScaleRoundOut(adj);
// of the anchor.
parentRect = parentRect.ConvertAppUnitsRoundOut(
aAnchorFrame->PresContext()->AppUnitsPerDevPixel(),
presContext->AppUnitsPerDevPixel());
// 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