Bug 906704 - fix infinite loop drawing rotated synthetic bold text. r=jrmuizel

This commit is contained in:
John Daggett 2013-08-28 08:36:02 +09:00
parent 702e2628d5
commit 08050e93bf
2 changed files with 8 additions and 6 deletions

View File

@ -757,9 +757,9 @@ gfxContext::UserToDevice(const gfxSize& size) const
} else {
const Matrix &matrix = mTransform;
gfxSize newSize = size;
newSize.width = newSize.width * matrix._11 + newSize.height * matrix._12;
newSize.height = newSize.width * matrix._21 + newSize.height * matrix._22;
gfxSize newSize;
newSize.width = size.width * matrix._11 + size.height * matrix._12;
newSize.height = size.width * matrix._21 + size.height * matrix._22;
return newSize;
}
}

View File

@ -2312,12 +2312,14 @@ gfxFont::Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
// synthetic-bold strikes are each offset one device pixel in run direction
// (these values are only needed if IsSyntheticBold() is true)
double synBoldOnePixelOffset = 0;
int32_t strikes = 0;
int32_t strikes = 1;
if (IsSyntheticBold()) {
double xscale = CalcXScale(aContext);
synBoldOnePixelOffset = direction * xscale;
// use as many strikes as needed for the the increased advance
strikes = NS_lroundf(GetSyntheticBoldOffset() / xscale);
if (xscale != 0.0) {
// use as many strikes as needed for the the increased advance
strikes = NS_lroundf(GetSyntheticBoldOffset() / xscale);
}
}
uint32_t i;