From bdaa45118f69d50a32a12ed047bbb3443b6950a5 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Tue, 27 May 2008 17:57:04 +0000 Subject: [PATCH] Bug 434157: Font scaling of Vista doesn't work as good with RC1 than it did with Betas, patch by roc@ocallahan.org, r=vlad, a=beltzner git-svn-id: svn://10.0.0.236/trunk@251850 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp b/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp index 2716278f9b5..45dd916d6e8 100644 --- a/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -240,8 +240,12 @@ nsThebesDeviceContext::SetDPI() // dev pixels per CSS pixel. Then, divide that into AppUnitsPerCSSPixel() // to get the number of app units per dev pixel. The PR_MAXes are to // make sure we don't end up dividing by zero. - mAppUnitsPerDevNotScaledPixel = PR_MAX(1, AppUnitsPerCSSPixel() / - PR_MAX(1, dpi / 96)); + PRUint32 roundedDPIScaleFactor = (dpi + 48)/96; +#ifdef MOZ_WIDGET_GTK2 + roundedDPIScaleFactor = dpi/96; +#endif + mAppUnitsPerDevNotScaledPixel = + PR_MAX(1, AppUnitsPerCSSPixel() / PR_MAX(1, roundedDPIScaleFactor)); } else { /* set mAppUnitsPerDevPixel so we're using exactly 72 dpi, even * though that means we have a non-integer number of device "pixels"