summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpathclipper
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-17 13:46:19 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-17 14:29:42 (GMT)
commitc65262cf3e3cd9c72184582306e550f686b2f27e (patch)
tree7e5857a1abf3b3378416810f90c94fc9509b8af8 /tests/auto/qpathclipper
parente3736c5031b941a665952a9696d989d79b25f32f (diff)
downloadQt-c65262cf3e3cd9c72184582306e550f686b2f27e.zip
Qt-c65262cf3e3cd9c72184582306e550f686b2f27e.tar.gz
Qt-c65262cf3e3cd9c72184582306e550f686b2f27e.tar.bz2
Fixed bugs in QPainterPath::united().
Change from a relative to an absolute fuzzy compare as was the case pre-4.4. With a relative fuzzy compare points that have an x or y coordinate of 0 will never be merged with points that are very close to 0, for example (1e-15, 0). Task-number: 251909 Reviewed-by: Trond
Diffstat (limited to 'tests/auto/qpathclipper')
-rw-r--r--tests/auto/qpathclipper/tst_qpathclipper.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qpathclipper/tst_qpathclipper.cpp b/tests/auto/qpathclipper/tst_qpathclipper.cpp
index f3077ee..6e6b632 100644
--- a/tests/auto/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/qpathclipper/tst_qpathclipper.cpp
@@ -93,6 +93,7 @@ private slots:
void task204301();
void task209056();
+ void task251909();
};
Q_DECLARE_METATYPE(QPainterPath)
@@ -1397,6 +1398,25 @@ void tst_QPathClipper::task209056()
QVERIFY(p3 != QPainterPath());
}
+void tst_QPathClipper::task251909()
+{
+ QPainterPath p1;
+ p1.moveTo(0, -10);
+ p1.lineTo(10, -10);
+ p1.lineTo(10, 0);
+ p1.lineTo(0, 0);
+
+ QPainterPath p2;
+ p2.moveTo(0, 8e-14);
+ p2.lineTo(10, -8e-14);
+ p2.lineTo(10, 10);
+ p2.lineTo(0, 10);
+
+ QPainterPath result = p1.united(p2);
+
+ QVERIFY(result.elementCount() <= 5);
+}
+
QTEST_APPLESS_MAIN(tst_QPathClipper)