summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-12-09 17:16:03 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-10 19:33:31 +0000
commite071eb1302465bd2bd5873cbe407e7550a50a947 (patch)
treecf1eda82abb6189ab05bb2ae365d3ec8620b5999
parent781b55b24e190442d7e055a5e54e8acb44104519 (diff)
Avoid overflowing QFixed in text layout
Fixes: QTBUG-89172 Change-Id: Icb78c8eeb1dbe4c5d4c6476beebafc0115a91e8c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 36ccbee34e89d185918a2925444dac11211e5c60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/text/qtextlayout.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index f3f0caa379..03f2acd700 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2508,6 +2508,9 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
return;
}
+ static QRectF maxFixedRect(QPointF(-QFIXED_MAX, -QFIXED_MAX), QPointF(QFIXED_MAX, QFIXED_MAX));
+ if (!maxFixedRect.contains(pos))
+ return;
QTextLineItemIterator iterator(eng, index, pos, selection);
QFixed lineBase = line.base();