зеркало из https://github.com/mozilla/pjs.git
use scaledpixels to convert from CSS pixels to realword pixels bug=307367 r/sr=roc
This commit is contained in:
Родитель
e632e0a349
Коммит
5a36c0dda6
|
@ -729,7 +729,7 @@ nsPresContext::Init(nsIDeviceContext* aDeviceContext)
|
|||
mInitialized = PR_TRUE;
|
||||
#endif
|
||||
|
||||
float pixelsToTwips = PixelsToTwips();
|
||||
float pixelsToTwips = ScaledPixelsToTwips();
|
||||
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_THIN] = NSIntPixelsToTwips(1, pixelsToTwips);
|
||||
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_MEDIUM] = NSIntPixelsToTwips(3, pixelsToTwips);
|
||||
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_THICK] = NSIntPixelsToTwips(5, pixelsToTwips);
|
||||
|
|
|
@ -388,6 +388,11 @@ public:
|
|||
*/
|
||||
NS_HIDDEN_(void) SetPageDim(const nsRect& aRect);
|
||||
|
||||
/**
|
||||
* Conversion from device pixels to twips.
|
||||
* WARNING: The misuse of this function to convert CSS pixels to twips
|
||||
* will cause problems during printing
|
||||
*/
|
||||
float PixelsToTwips() const { return mDeviceContext->DevUnitsToAppUnits(); }
|
||||
|
||||
float TwipsToPixels() const { return mDeviceContext->AppUnitsToDevUnits(); }
|
||||
|
@ -396,7 +401,7 @@ public:
|
|||
|
||||
//XXX this is probably not an ideal name. MMP
|
||||
/**
|
||||
* Do pixels to twips conversion taking into account
|
||||
* Do CSS pixels to twips conversion taking into account
|
||||
* differing size of a "pixel" from device to device.
|
||||
*/
|
||||
NS_HIDDEN_(float) ScaledPixelsToTwips() const;
|
||||
|
|
Загрузка…
Ссылка в новой задаче