diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-09-23 10:31:32 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-09-23 20:08:56 +0200 |
commit | ce4c26c8d16fbc9fdafd8325b8a0b32bacd8cd93 (patch) | |
tree | 167f059436514772d8aa1f3cef389cdfb4b9837a /src/gui/text/qtextlayout.cpp | |
parent | 9516823fce1d6f9bb7446fba8192396453af1557 (diff) |
Revert "QTextLayout: fix maximumWidth() for a text containing line separator"
This reverts commit 013c346a8dcbd618febb07884c64c740daf9754d. It was
determined to cause a regression in Qt Quick: QTBUG-106899.
In order to unblock integrations, we need to revert the change. It
can be re-committed later when the problem has been analyzed and
addressed.
Pick-to: 6.2 6.4
Fixes: QTBUG-106899
Task-number: QTBUG-89557
Task-number: QTBUG-104986
Change-Id: I04054587f68ab39fdb038b02fc69ebfa3dc7d197
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index b88c902aca..9cf5d8963b 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1808,7 +1808,6 @@ void QTextLine::layout_helper(int maxGlyphs) lbh.logClusters = eng->layoutData->logClustersPtr; lbh.previousGlyph = 0; - bool manuallyWrapped = false; bool hasInlineObject = false; QFixed maxInlineObjectHeight = 0; @@ -1884,7 +1883,6 @@ void QTextLine::layout_helper(int maxGlyphs) lbh.calculateRightBearingForPreviousGlyph(); } line += lbh.tmpData; - manuallyWrapped = true; goto found; } else if (current.analysis.flags == QScriptAnalysis::Object) { lbh.whiteSpaceOrObject = true; @@ -2107,10 +2105,7 @@ found: eng->maxWidth = qMax(eng->maxWidth, line.textWidth); } else { eng->minWidth = qMax(eng->minWidth, lbh.minw); - if (eng->layoutData->previousLineManuallyWrapped) - eng->maxWidth = qMax(eng->maxWidth, line.textWidth); - else - eng->maxWidth += line.textWidth; + eng->maxWidth += line.textWidth; } if (line.textWidth > 0 && item < eng->layoutData->items.size()) @@ -2124,8 +2119,6 @@ found: line.justified = false; line.gridfitted = false; - - eng->layoutData->previousLineManuallyWrapped = manuallyWrapped; } /*! |