Fix divide by zero when glyphWidth is 0
Change-Id: Ic0108b76b8d73cc977f8d64e036a65cb93db4684 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>bb10
parent
c2baf45c73
commit
7df4890d8a
|
|
@ -2702,6 +2702,8 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
|
|||
QFixed glyphWidth = glyphs.effectiveAdvance(glyph_pos);
|
||||
// the approximate width of each individual element of the ligature
|
||||
QFixed perItemWidth = glyphWidth / clusterLength;
|
||||
if (perItemWidth <= 0)
|
||||
return si->position + clusterStart;
|
||||
QFixed left = x > edge ? edge : edge - glyphWidth;
|
||||
int n = ((x - left) / perItemWidth).floor().toInt();
|
||||
QFixed dist = x - left - n * perItemWidth;
|
||||
|
|
|
|||
Loading…
Reference in New Issue