summaryrefslogtreecommitdiffstats
path: root/src/gui
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>2020-12-10 21:19:01 +0000
commitfbcc6a346b81a04f8a5f1a8a05aa973a58a64fc7 (patch)
tree0435c21748e494f281fb541a15fa8b6cad4ba2fe /src/gui
parent3c8d95afa56e9787f222086b1918616aeb9d5337 (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>
Diffstat (limited to 'src/gui')
-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 6c18c53bca..d303219bb9 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2510,6 +2510,9 @@ void QTextLine::draw_internal(QPainter *p, const QPointF &pos,
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();