Fix broken text layout with ShowLineAndParagraphSeparators
Before we add the current cluster we need to check if there's space for it. Calling checkFullOtherwiseExtend() also has the side effect of resetting the space data. We would add the cluster without checking for space when showing separators, causing broken behavior like we would count the space in the current item as trailing space, which would make us chop the end of the string. Task-number: QTBUG-28832 Change-Id: I8169662218ff6e645575d4e89a57f6b234f3c4cb Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
parent
96a11284f2
commit
d4b30757ab
@ -1788,6 +1788,9 @@ void QTextLine::layout_helper(int maxGlyphs)
|
||||
if (!line.length && !lbh.tmpData.length)
|
||||
line.setDefaultHeight(eng);
|
||||
if (eng->option.flags() & QTextOption::ShowLineAndParagraphSeparators) {
|
||||
if (lbh.checkFullOtherwiseExtend(line))
|
||||
goto found;
|
||||
|
||||
addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount,
|
||||
current, lbh.logClusters, lbh.glyphs);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user