r=pedemonte, sr=blizzard (platform specific), a=mkaply
OS/2 only - occasional pixel error when scrolling
This commit is contained in:
mkaply%us.ibm.com 2003-09-02 21:21:53 +00:00
Родитель c4ef0c0f8c
Коммит 919ed46ccf
1 изменённых файлов: 7 добавлений и 15 удалений

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

@ -151,16 +151,10 @@ nsresult nsDeviceContextOS2::Init( nsNativeDeviceContext aContext,
long dpi; long dpi;
GFX (::DevQueryCaps(mPrintDC, CAPS_VERTICAL_FONT_RES, 1, &dpi), FALSE); GFX (::DevQueryCaps(mPrintDC, CAPS_VERTICAL_FONT_RES, 1, &dpi), FALSE);
int pt2t = 72; mPixelsToTwips = NSToIntRound((float)NSIntPointsToTwips(72) / ((float)dpi));
mTwipsToPixels = 1.0 / mPixelsToTwips;
// make p2t a nice round number - this prevents rounding problems
// mPixelsToTwips = float(NSToIntRound(float(NSIntPointsToTwips(pt2t)) / float(dpi)));
// mTwipsToPixels = 1.0f / mPixelsToTwips;
mTwipsToPixels = ((float)dpi) / (float)NSIntPointsToTwips(72);
mPixelsToTwips = 1.0f / mTwipsToPixels;
GetTwipsToDevUnits( newscale);
GetTwipsToDevUnits(newscale);
// On OS/2, origscale can be different based on the video resolution. // On OS/2, origscale can be different based on the video resolution.
// On 640x480, it's 1/15, on everything else it is 1/12. // On 640x480, it's 1/15, on everything else it is 1/12.
// For consistent printing, 1/15 is the correct value to use. // For consistent printing, 1/15 is the correct value to use.
@ -170,8 +164,8 @@ nsresult nsDeviceContextOS2::Init( nsNativeDeviceContext aContext,
mCPixelScale = newscale / origscale; mCPixelScale = newscale / origscale;
aOrigContext->GetTwipsToDevUnits( t2d); aOrigContext->GetTwipsToDevUnits(t2d);
aOrigContext->GetAppUnitsToDevUnits( a2d); aOrigContext->GetAppUnitsToDevUnits(a2d);
mAppUnitsToDevUnits = (a2d / t2d) * mTwipsToPixels; mAppUnitsToDevUnits = (a2d / t2d) * mTwipsToPixels;
mDevUnitsToAppUnits = 1.0f / mAppUnitsToDevUnits; mDevUnitsToAppUnits = 1.0f / mAppUnitsToDevUnits;
@ -605,10 +599,8 @@ nsDeviceContextOS2::SetDPI(PRInt32 aPrefDPI)
int pt2t = 72; int pt2t = 72;
// make p2t a nice round number - this prevents rounding problems // make p2t a nice round number - this prevents rounding problems
// mPixelsToTwips = float(NSToIntRound(float(NSIntPointsToTwips(pt2t)) / float(mDpi))); mPixelsToTwips = float(NSToIntRound(float(NSIntPointsToTwips(pt2t)) / float(mDpi)));
// mTwipsToPixels = 1.0f / mPixelsToTwips; mTwipsToPixels = 1.0f / mPixelsToTwips;
mTwipsToPixels = ((float)mDpi) / (float)NSIntPointsToTwips(72);
mPixelsToTwips = 1.0f / mTwipsToPixels;
// XXX need to reflow all documents // XXX need to reflow all documents
return NS_OK; return NS_OK;