QTextLayout: Fix cursor position calculation for BiDi text

Due excess 'break' in loop, function xToCursor() with "CursorOnCharacter" option
for BiDI text returns wrong cursor position (start glyph position) all time.

Task-number: QTBUG-38846
Change-Id: Iba6671905e0785da6f343db19d6c3bb3e2cf5e8a
Reviewed-by: Andrey Volykhin <andrey.volykhin@lge.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Andrey Volykhin 2014-05-08 17:10:25 +04:00 committed by The Qt Project
parent 3cf9621fa0
commit 793b7e8008

View File

@ -2810,7 +2810,6 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
break; break;
glyph_pos = gs; glyph_pos = gs;
edge = pos; edge = pos;
break;
} }
pos -= glyphs.effectiveAdvance(gs); pos -= glyphs.effectiveAdvance(gs);
++gs; ++gs;