summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-05-31 10:00:54 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-05-31 13:18:10 +0200
commit817469519a784b1cc84f89cb3cb84f7560874f8e (patch)
treed4bac4e4e96cc52d79ffe3e7e1e6258cca33e357 /src
parent59e281bcc2bc24ae93eaf2751cc6fcc48bfd6302 (diff)
Fix unreasonably large width of QTextLayout::boundingRect()
When no lineWidth is set on the QTextLine, the QScriptLine::width will be the maximum value that can be represented by QFixed, thus always overriding the width of the bounding rect. The lineWidth of the QTextLine should never be used as the width of the bounding rect, since it's not a calculated value. The real bounding rect is found by querying the natural text width. Task-number: QTBUG-11104 Reviewed-by: Rhys Weatherley
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextlayout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index ce7915d8e9..a1a17af267 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -858,7 +858,7 @@ QRectF QTextLayout::boundingRect() const
const QScriptLine &si = d->lines[i];
xmin = qMin(xmin, si.x);
ymin = qMin(ymin, si.y);
- xmax = qMax(xmax, si.x+qMax(si.width, si.textWidth));
+ xmax = qMax(xmax, si.x+si.textWidth);
// ### shouldn't the ascent be used in ymin???
ymax = qMax(ymax, si.y+si.height());
}