r=jkobal, a=blizzard
Printing shouldn't be resolution dependent
This commit is contained in:
mkaply%us.ibm.com 2001-01-26 00:48:05 +00:00
Родитель 8c3dd31086
Коммит 06fa33ccb8
2 изменённых файлов: 11 добавлений и 4 удалений

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

@ -64,6 +64,7 @@ nsDeviceContextOS2 :: nsDeviceContextOS2()
mCachedClientRect = PR_FALSE; mCachedClientRect = PR_FALSE;
mCachedFullRect = PR_FALSE; mCachedFullRect = PR_FALSE;
mSupportsRasterFonts = PR_FALSE; mSupportsRasterFonts = PR_FALSE;
mPelsPerMeter = 0;
#ifdef XP_OS2 #ifdef XP_OS2
mPrintState = nsPrintState_ePreBeginDoc; mPrintState = nsPrintState_ePreBeginDoc;
#endif #endif
@ -121,7 +122,7 @@ nsresult nsDeviceContextOS2::Init( nsNativeWidget aWidget)
nsresult nsDeviceContextOS2::Init( nsNativeDeviceContext aContext, nsresult nsDeviceContextOS2::Init( nsNativeDeviceContext aContext,
nsIDeviceContext *aOrigContext) nsIDeviceContext *aOrigContext)
{ {
float origscale, newscale; // float origscale, newscale;
float t2d, a2d; float t2d, a2d;
mPrintDC = (HDC)aContext; mPrintDC = (HDC)aContext;
@ -141,10 +142,13 @@ nsresult nsDeviceContextOS2::Init( nsNativeDeviceContext aContext,
CommonInit( mPrintDC); CommonInit( mPrintDC);
GetTwipsToDevUnits( newscale); // GetTwipsToDevUnits( newscale);
aOrigContext->GetTwipsToDevUnits( origscale); // aOrigContext->GetTwipsToDevUnits( origscale);
mPixelScale = newscale / origscale; // mPixelScale = newscale / origscale;
mPixelScale = (float)mPelsPerMeter / 3622.0f; /* This is ugly - it prevents different size printing on different */
/* Resolutions */
aOrigContext->GetTwipsToDevUnits( t2d); aOrigContext->GetTwipsToDevUnits( t2d);
aOrigContext->GetAppUnitsToDevUnits( a2d); aOrigContext->GetAppUnitsToDevUnits( a2d);
@ -182,6 +186,8 @@ void nsDeviceContextOS2 :: CommonInit(HDC aDC)
mPixelsToTwips = 1.0f / mTwipsToPixels; mPixelsToTwips = 1.0f / mTwipsToPixels;
mPelsPerMeter = alArray[CAPS_VERTICAL_RESOLUTION];
mDepth = alArray[CAPS_COLOR_BITCOUNT]; mDepth = alArray[CAPS_COLOR_BITCOUNT];
mPaletteInfo.isPaletteDevice = !!(alArray[CAPS_ADDITIONAL_GRAPHICS] & CAPS_PALETTE_MANAGER); mPaletteInfo.isPaletteDevice = !!(alArray[CAPS_ADDITIONAL_GRAPHICS] & CAPS_PALETTE_MANAGER);

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

@ -98,6 +98,7 @@ protected:
nsRect mClientRect; nsRect mClientRect;
nsIDeviceContextSpec *mSpec; nsIDeviceContextSpec *mSpec;
PRBool mSupportsRasterFonts; PRBool mSupportsRasterFonts;
PRUint32 mPelsPerMeter;
nsCOMPtr<nsIScreenManager> mScreenManager; nsCOMPtr<nsIScreenManager> mScreenManager;
static PRUint32 sNumberOfScreens; static PRUint32 sNumberOfScreens;