bug #7796: changed nsDeviceContextMac::GetDeviceSurfaceDimensions() to return the dimensions of the entire Mac desktop using LMGetGrayRgn().

This commit is contained in:
beard%netscape.com 1999-07-23 01:59:18 +00:00
Родитель 264c3db8b2
Коммит 478b3de4ef
2 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -26,6 +26,7 @@
#include <StringCompare.h>
#include <Fonts.h>
#include <Resources.h>
#include <LowMem.h>
#include "il_util.h"
#include <FixMath.h>
#include "nsIPref.h"
@ -321,10 +322,12 @@ NS_IMETHODIMP nsDeviceContextMac :: CheckFontExistence(const nsString& aFontName
NS_IMETHODIMP nsDeviceContextMac::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight)
{
aWidth = 1;
aHeight = 1;
return NS_ERROR_FAILURE;
// FIXME: could just union all of the GDevice rectangles together.
RgnHandle grayRgn = LMGetGrayRgn();
Rect bounds = (**grayRgn).rgnBBox;
aWidth = bounds.right - bounds.left;
aHeight = bounds.bottom - bounds.top;
return NS_OK;
}

Просмотреть файл

@ -26,6 +26,7 @@
#include <StringCompare.h>
#include <Fonts.h>
#include <Resources.h>
#include <LowMem.h>
#include "il_util.h"
#include <FixMath.h>
#include "nsIPref.h"
@ -321,10 +322,12 @@ NS_IMETHODIMP nsDeviceContextMac :: CheckFontExistence(const nsString& aFontName
NS_IMETHODIMP nsDeviceContextMac::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight)
{
aWidth = 1;
aHeight = 1;
return NS_ERROR_FAILURE;
// FIXME: could just union all of the GDevice rectangles together.
RgnHandle grayRgn = LMGetGrayRgn();
Rect bounds = (**grayRgn).rgnBBox;
aWidth = bounds.right - bounds.left;
aHeight = bounds.bottom - bounds.top;
return NS_OK;
}