From ddc842fee9ffe0e683f6ea633d860412b51bae33 Mon Sep 17 00:00:00 2001 From: "stridey%gmail.com" Date: Tue, 27 Mar 2007 23:24:15 +0000 Subject: [PATCH] Bug 350018: Fix Cocoa origin point for rects with height. Patch by Javier Pedemonte . r=smorgan a=dveditz git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@222503 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsChildView.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/widget/src/cocoa/nsChildView.mm b/mozilla/widget/src/cocoa/nsChildView.mm index b397e3125c2..7a048cc10a9 100644 --- a/mozilla/widget/src/cocoa/nsChildView.mm +++ b/mozilla/widget/src/cocoa/nsChildView.mm @@ -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;