mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1234418 - Not trust glyph run starts from a cluster start character. r=jfkthame
This commit is contained in:
parent
055d6fade6
commit
0d34f11ff8
@ -1859,13 +1859,13 @@ gfxFont::DrawEmphasisMarks(gfxTextRun* aShapedText, gfxPoint* aPt,
|
||||
gfxFloat& inlineCoord = aParams.isVertical ? aPt->y : aPt->x;
|
||||
uint32_t markLength = aParams.mark->GetLength();
|
||||
|
||||
gfxFloat clusterStart = NAN;
|
||||
gfxFloat clusterStart = -INFINITY;
|
||||
bool shouldDrawEmphasisMark = false;
|
||||
for (uint32_t i = 0, idx = aOffset; i < aCount; ++i, ++idx) {
|
||||
if (aParams.spacing) {
|
||||
inlineCoord += aParams.direction * aParams.spacing[i].mBefore;
|
||||
}
|
||||
if (aShapedText->IsClusterStart(idx)) {
|
||||
if (aShapedText->IsClusterStart(idx) || clusterStart == -INFINITY) {
|
||||
clusterStart = inlineCoord;
|
||||
}
|
||||
if (aShapedText->CharMayHaveEmphasisMark(idx)) {
|
||||
@ -1874,7 +1874,6 @@ gfxFont::DrawEmphasisMarks(gfxTextRun* aShapedText, gfxPoint* aPt,
|
||||
inlineCoord += aParams.direction * aShapedText->GetAdvanceForGlyph(idx);
|
||||
if (shouldDrawEmphasisMark &&
|
||||
(i + 1 == aCount || aShapedText->IsClusterStart(idx + 1))) {
|
||||
MOZ_ASSERT(!std::isnan(clusterStart), "Should have cluster start");
|
||||
gfxFloat clusterAdvance = inlineCoord - clusterStart;
|
||||
// Move the coord backward to get the needed start point.
|
||||
gfxFloat delta = (clusterAdvance + aParams.advance) / 2;
|
||||
|
Loading…
Reference in New Issue
Block a user