summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-08-11 15:34:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-21 15:04:51 +0200
commit5f198584e206cb8ab85d0474ce19d0faabce9468 (patch)
tree13a39af5459692720e50f5cff0235d59f74aeea0 /tests/auto/gui/painting/qpainter/tst_qpainter.cpp
parentb8a03411784803c07ecc1f769860756d6fdc04cd (diff)
Define inverted QRects consistently
Changes the definition of invalid QRects to be more consistent. This simplifies the logic, and makes it possible for us to fix normalized() so dimensions don't change. The actual API is not changed except for inverted rects. Only one use-case for the old normalized() function existed, and has been reimplemented as QRect::span(). Fixes: QTBUG-22934 Change-Id: I29dad2952dc6c8e84a6d931898dc7e43d66780f3 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/gui/painting/qpainter/tst_qpainter.cpp')
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 9c5a52f2d9..7b64e3dddb 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -815,7 +815,7 @@ void tst_QPainter::drawLine()
qMin(line.y1(), line.y2())
+ 2*offset + qAbs(line.dy()));
{ // clipped
- const QRect clip = QRect(line.p1(), line.p2()).normalized();
+ const QRect clip = QRect::span(line.p1(), line.p2());
pixmapClipped.fill(Qt::white);
QPainter p(&pixmapClipped);