Bug 350018: Fix Cocoa origin point for rects with height. Patch by Javier Pedemonte <jhpedemonte@gmail.com>. r=smorgan a=dveditz

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@222503 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
stridey%gmail.com
2007-03-27 23:24:15 +00:00
parent 5fcb7e25e7
commit ddc842fee9

View File

@@ -1806,6 +1806,12 @@ NS_IMETHODIMP nsChildView::WidgetToScreen(const nsRect& aLocalRect, nsRect& aGlo
temp.origin.y = NSMaxY(mainScreenFrame) - temp.origin.y;
}
// If this is rect has a size (and is not simply a point), it is important to account
// for the fact that convertRect:toView:nil thought our passed-in point was in bottom-left
// coords. Thus, we subtract the rect's height, to get the top-left rect's origin
// where we want it.
temp.origin.y -= temp.size.height;
ConvertCocoaToGeckoRect(temp, aGlobalRect);
return NS_OK;