Fix ligature handling in QTextLine::cursorToX()
If the script item is rtl, we need to subtract the offset inside the ligature again, as the full width of the ligature would have already been added in the loop before. Change-Id: I544ac6fa19484b35335767e1ba1befc3dfa07693 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
5d365b96b9
commit
4804d42ab8
|
|
@ -2762,6 +2762,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
|
|||
glyph_start++;
|
||||
for (int i = glyph_end - 1; i >= glyph_start; i--)
|
||||
x += glyphs.effectiveAdvance(i);
|
||||
x -= eng->offsetInLigature(si, pos, end, glyph_pos);
|
||||
} else {
|
||||
int start = qMax(line.from - si->position, 0);
|
||||
int glyph_start = logClusters[start];
|
||||
|
|
@ -2770,8 +2771,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
|
|||
glyph_end--;
|
||||
for (int i = glyph_start; i <= glyph_end; i++)
|
||||
x += glyphs.effectiveAdvance(i);
|
||||
x += eng->offsetInLigature(si, pos, end, glyph_pos);
|
||||
}
|
||||
x += eng->offsetInLigature(si, pos, end, glyph_pos);
|
||||
}
|
||||
|
||||
if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.x + line.width)
|
||||
|
|
|
|||
Loading…
Reference in New Issue