From 63cd34d3cfbee2bf611606e32d257cbdb9b35393 Mon Sep 17 00:00:00 2001 From: "dcone%netscape.com" Date: Fri, 27 Aug 1999 14:22:14 +0000 Subject: [PATCH] Fixed GetDeviceSurfaceDimensions() so the width and height are in appunits, and the routines who use them will convert properly. git-svn-id: svn://10.0.0.236/trunk@44835 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/mac/nsDeviceContextMac.cpp | 10 +++++++--- mozilla/widget/src/mac/nsDeviceContextMac.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index 6deee1c1405..923ccb6b863 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -325,9 +325,13 @@ NS_IMETHODIMP nsDeviceContextMac::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PR // FIXME: could just union all of the GDevice rectangles together. RgnHandle grayRgn = ::GetGrayRgn(); Rect bounds = (**grayRgn).rgnBBox; - aWidth = bounds.right - bounds.left; - aHeight = bounds.bottom - bounds.top; - return NS_OK; + //aWidth = bounds.right - bounds.left; + //aHeight = bounds.bottom - bounds.top; + + aHeight = NSToIntRound((bounds.bottom - bounds.top)*mDevUnitsToAppUnits); + aWidth = NSToIntRound((bounds.right - bounds.left) * mDevUnitsToAppUnits); + + return NS_OK; } diff --git a/mozilla/widget/src/mac/nsDeviceContextMac.cpp b/mozilla/widget/src/mac/nsDeviceContextMac.cpp index 6deee1c1405..923ccb6b863 100644 --- a/mozilla/widget/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/widget/src/mac/nsDeviceContextMac.cpp @@ -325,9 +325,13 @@ NS_IMETHODIMP nsDeviceContextMac::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PR // FIXME: could just union all of the GDevice rectangles together. RgnHandle grayRgn = ::GetGrayRgn(); Rect bounds = (**grayRgn).rgnBBox; - aWidth = bounds.right - bounds.left; - aHeight = bounds.bottom - bounds.top; - return NS_OK; + //aWidth = bounds.right - bounds.left; + //aHeight = bounds.bottom - bounds.top; + + aHeight = NSToIntRound((bounds.bottom - bounds.top)*mDevUnitsToAppUnits); + aWidth = NSToIntRound((bounds.right - bounds.left) * mDevUnitsToAppUnits); + + return NS_OK; }