From c2225ded68d79a836bdb2b9306cd9ad84229560e Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Thu, 8 Oct 2009 11:14:40 +0200 Subject: [PATCH] Bug 426788 - When DPI set to 144, User interface is scretched very much. and html document is rendered very large, r=roc --- gfx/src/thebes/nsThebesDeviceContext.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp index f7491c684864..965903a28563 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -685,16 +685,11 @@ nsThebesDeviceContext::SetDPI() if (dotsArePixels) { if (prefDevPixelsPerCSSPixel <= 0) { - // First figure out the closest multiple of 96, which is the number of - // 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. - PRUint32 roundedDPIScaleFactor = (dpi + 48)/96; -#ifdef MOZ_WIDGET_GTK2 - // be more conservative about activating scaling on GTK2, since the dpi - // information is more likely to be wrong - roundedDPIScaleFactor = dpi/96; -#endif + // Round down to multiple of 96, which is the number of 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. + PRUint32 roundedDPIScaleFactor = dpi/96; mAppUnitsPerDevNotScaledPixel = PR_MAX(1, AppUnitsPerCSSPixel() / PR_MAX(1, roundedDPIScaleFactor)); } else {