diff options
author | David Faure <david.faure@kdab.com> | 2013-11-18 18:52:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-05 16:40:06 +0100 |
commit | d270bd8673505d8325ce25fa8476c8f8bc5a075b (patch) | |
tree | d73c1ac63c0663f4cb7ce8fb63465e0b417313a9 /src/gui | |
parent | d443eff5b67fdf51cb3f1aca763bd3c407158720 (diff) |
QTextEngine: fix layouting of inline objects in right-aligned tabs.
(same thing for center- and delimiter-aligned tabs)
The width of the inline object wasn't taken into account, the code in
QTextEngine::calculateTabWidth only looked at glyph widths.
Change-Id: I303a6561c67870ff2094a685698e642fc1b53b12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 6345ed7682..08b0491ddc 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2878,6 +2878,10 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const if (item.position > tabSectionEnd || item.position <= si.position) continue; shape(i); // first, lets make sure relevant text is already shaped + if (item.analysis.flags == QScriptAnalysis::Object) { + length += item.width; + continue; + } QGlyphLayout glyphs = this->shapedGlyphs(&item); const int end = qMin(item.position + item.num_glyphs, tabSectionEnd) - item.position; for (int i=0; i < end; i++) |