diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-03-30 07:25:38 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-03-30 07:27:04 (GMT) |
commit | 5ef6ac6550f1692d66611e7918d85c7ebedda439 (patch) | |
tree | dcad304b13530179d58040cb1775c3e835c27094 /tests/auto/qpainter | |
parent | 489da53d86c41d4cb0ce4e533c40b7f5dcae4d0e (diff) | |
download | Qt-5ef6ac6550f1692d66611e7918d85c7ebedda439.zip Qt-5ef6ac6550f1692d66611e7918d85c7ebedda439.tar.gz Qt-5ef6ac6550f1692d66611e7918d85c7ebedda439.tar.bz2 |
Fix missing fills of rects with negative width/height in raster engine.
Call isEmpty() on the normalized rect instead of the original rect.
Task-number: 247505
Reviewed-by:
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 2e1335c..a4c768d 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -203,6 +203,7 @@ private slots: void drawImage_task217400_data(); void drawImage_task217400(); void drawRect_task215378(); + void drawRect_task247505(); void drawImage_data(); void drawImage(); @@ -3589,6 +3590,26 @@ void tst_QPainter::drawRect_task215378() QVERIFY(img.pixel(0, 0) != img.pixel(1, 1)); } +void tst_QPainter::drawRect_task247505() +{ + QImage a(10, 10, QImage::Format_ARGB32_Premultiplied); + a.fill(0); + QImage b = a; + + QPainter p(&a); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawRect(QRectF(10, 0, -10, 10)); + p.end(); + p.begin(&b); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawRect(QRectF(0, 0, 10, 10)); + p.end(); + + QCOMPARE(a, b); +} + void tst_QPainter::drawImage_data() { QTest::addColumn<int>("x"); |