summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentlayout.cpp
diff options
context:
space:
mode:
authorNils Jeisecke <nils.jeisecke@saltation.com>2019-07-17 21:05:44 +0200
committerNils Jeisecke <nils.jeisecke@saltation.com>2019-08-07 22:15:04 +0200
commit81554aca81ec4e161ff9fa236e3d76fa950fec97 (patch)
tree7c4d84713b8f366c564d8779689166faa961af00 /src/gui/text/qtextdocumentlayout.cpp
parent80179e3b7e91bbe4d129b95eab8c6350e26f5569 (diff)
QTextDocumentLayout: Fix regression in table column width calculation
87748cc18e6a0d9e65933aa2462dc78ab8f9f22e introduces rounding of column widths to avoid table border render artifacts. For variable columns we must make sure that the maxWidth (= unwrapped content width) is not rounded down as this can cause erroneous wrapping of the content at rendering time. Fixes: QTBUG-43589 Change-Id: Iee155702a12374116a63050e5025df91f097a8e4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocumentlayout.cpp')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index a1b21b111b..783a7b083d 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -1707,6 +1707,12 @@ recalc_minmax_widths:
if (maxW == QFIXED_MAX)
continue;
+ // for variable columns the maxWidth will later be considered as the
+ // column width (column width = content width). We must avoid that the
+ // pixel-alignment rounding step floors this value and thus the text
+ // rendering later erroneously wraps the content.
+ maxW = maxW.ceil();
+
widthToDistribute = maxW;
for (int n = 0; n < cspan; ++n) {
const int col = i + n;