From 6dd35fc852c1300eac0e122a702835b56589989d Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Fri, 11 May 2007 22:54:31 -0700 Subject: [PATCH] Bug 380210. Fix appunits to Pango units conversions (only affects newtextframe). r=vlad --- gfx/thebes/src/gfxPangoFonts.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gfx/thebes/src/gfxPangoFonts.cpp b/gfx/thebes/src/gfxPangoFonts.cpp index 4d7c80838b40..f8caa4569246 100644 --- a/gfx/thebes/src/gfxPangoFonts.cpp +++ b/gfx/thebes/src/gfxPangoFonts.cpp @@ -934,7 +934,7 @@ gfxPangoFont::Measure(gfxTextRun *aTextRun, glyphInfo->attr.is_cluster_start = 0; glyphInfo->glyph = glyphData->GetSimpleGlyph(); glyphInfo->geometry.width = leftSpacePango + rightSpacePango + - glyphData->GetSimpleAdvance()*PANGO_SCALE; + NS_lround(glyphData->GetSimpleAdvance()*appUnitsToPango); glyphInfo->geometry.x_offset = leftSpacePango; glyphInfo->geometry.y_offset = 0; } else if (glyphData->IsComplexCluster()) { @@ -946,14 +946,14 @@ gfxPangoFont::Measure(gfxTextRun *aTextRun, return gfxTextRun::Metrics(); glyphInfo->attr.is_cluster_start = 0; glyphInfo->glyph = details->mGlyphID; - glyphInfo->geometry.width = NS_lround(details->mAdvance*PANGO_SCALE); - glyphInfo->geometry.x_offset = NS_lround(details->mXOffset*PANGO_SCALE); + glyphInfo->geometry.width = NS_lround(details->mAdvance*appUnitsToPango); + glyphInfo->geometry.x_offset = NS_lround(details->mXOffset*appUnitsToPango); if (firstGlyph) { glyphInfo->geometry.width += leftSpacePango; glyphInfo->geometry.x_offset += leftSpacePango; firstGlyph = PR_FALSE; } - glyphInfo->geometry.y_offset = NS_lround(details->mYOffset*PANGO_SCALE); + glyphInfo->geometry.y_offset = NS_lround(details->mYOffset*appUnitsToPango); if (details->mIsLastGlyph) { glyphInfo->geometry.width += rightSpacePango; break;