summaryrefslogtreecommitdiff
path: root/tests/auto/qpathclipper
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-17 15:46:19 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-06-17 16:29:42 +0200
commitc65262cf3e3cd9c72184582306e550f686b2f27e (patch)
tree7e5857a1abf3b3378416810f90c94fc9509b8af8 /tests/auto/qpathclipper
parente3736c5031b941a665952a9696d989d79b25f32f (diff)
downloadqt4-tools-c65262cf3e3cd9c72184582306e550f686b2f27e.tar.gz
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 f3077ee391..6e6b632b1e 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)