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
This commit is contained in:
dcone%netscape.com 1999-08-27 14:22:14 +00:00
parent d7e1f74167
commit 63cd34d3cf
2 changed files with 14 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}