bug 615121 - fix operator precedence error in glyph yoffset. r=jfkthame a=blocking-betaN
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 30 Nov 2010 15:44:35 +0000
changeset 58371 3e3726fc8083971b223952a29cf2289ed0915867
parent 58370 71705aa67f3eeffedc91e0852f0c6e77f09fa59a
child 58372 a5aafda069f700ef87e2b04b7055a0e2d281506f
push id17271
push userjkew@mozilla.com
push dateTue, 30 Nov 2010 15:49:31 +0000
treeherdermozilla-central@ff3d2362e3f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, blocking-betaN
bugs615121
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 615121 - fix operator precedence error in glyph yoffset. r=jfkthame a=blocking-betaN
gfx/thebes/gfxFont.h
gfx/thebes/gfxHarfBuzzShaper.cpp
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -1788,17 +1788,17 @@ public:
      */
     struct DetailedGlyph {
         /** The glyphID, or the Unicode character
          * if this is a missing glyph */
         PRUint32 mGlyphID;
         /** The advance, x-offset and y-offset of the glyph, in appunits
          *  mAdvance is in the text direction (RTL or LTR)
          *  mXOffset is always from left to right
-         *  mYOffset is always from bottom to top */   
+         *  mYOffset is always from top to bottom */   
         PRInt32  mAdvance;
         float    mXOffset, mYOffset;
     };
 
     // The text is divided into GlyphRuns as necessary
     struct GlyphRun {
         nsRefPtr<gfxFont> mFont;   // never null
         PRUint32          mCharacterOffset; // into original UTF16 string
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -1127,18 +1127,18 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxC
                 // not accumulate, and that advances are typically between
                 // clusters.
                 hb_position_t x_offset = posInfo[glyphStart].x_offset;
                 details->mXOffset =
                     roundX ? dev2appUnits * FixedToIntRound(x_offset)
                     : NS_floor(hb2appUnits * x_offset + 0.5);
                 hb_position_t y_offset = posInfo[glyphStart].y_offset;
                 details->mYOffset = yPos -
-                    roundY ? dev2appUnits * FixedToIntRound(y_offset)
-                    : NS_floor(hb2appUnits * y_offset + 0.5);
+                    (roundY ? dev2appUnits * FixedToIntRound(y_offset)
+                     : NS_floor(hb2appUnits * y_offset + 0.5));
 
                 details->mAdvance = advance;
                 hb_position_t y_advance = posInfo[glyphStart].y_advance;
                 if (y_advance != 0) {
                     yPos -=
                         roundY ? dev2appUnits * FixedToIntRound(y_advance)
                         : NS_floor(hb2appUnits * y_advance + 0.5);
                 }