summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-12-06 12:49:10 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-07 05:40:51 +0000
commitf666eafd4f8eac257b7c6357f969bf89543c1d79 (patch)
treea941728959bf74c2766ee8596e3b5a4644095c6d
parent0e9c5b1d1c8c90e4db4c8341080d39094e7fc50a (diff)
Fix qtdeclarative baseline test failure for text tables
Amend 97cfd4940157817dd761fd02f2e6da4afc5b4a30, which resulted in incorrectly laid out tables in Text elements. Reported by the baseline test for the scenegraph. Not reproducible using a QtWidget text widget, so no unit-test added here. Task-number: QTBUG-86671 Task-number: QTBUG-97463 Change-Id: I607b1fea3fb5923f81f05a3646bafebec3dcf3b5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 220510a885747bb084e23dc51ea31e35e4fd115e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index cff40c77c3..1a055a1765 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2361,10 +2361,10 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
floatMinWidth = qMax(floatMinWidth, cd->minimumWidth);
}
- // constraint the maximumWidth by the minimum width of the fixed size floats, to
- // keep them visible
+ // constraint the maximum/minimumWidth by the minimum width of the fixed size floats,
+ // to keep them visible
layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth);
- layoutStruct.minimumWidth = floatMinWidth;
+ layoutStruct.minimumWidth = qMax(layoutStruct.minimumWidth, floatMinWidth);
// as floats in cells get added to the table's float list but must not affect
// floats in other cells we must clear the list here.