From d7b4d694214d1dd8ef84ac2ae69c94b8564fd8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 22 Apr 2010 16:04:09 +0200 Subject: Fixed autotest failures in tst_QPainterPath. The simplified test failed because the ellipse was flattened into line segment. The other tests were due to a behavioral change in contains() and intersect() caused by using fill based intersection in change f7d61dab69308f0993c8a5f2232226d1713ac4a7. This needs to be reverted, since it will return false for a rect containing a line (with no fill area). Instead a different fix was needed in linesIntersect() to prevent testIntersections() in tst_QPathClipper from failing. Reviewed-by: Trond --- src/gui/painting/qpathclipper.cpp | 9 ++------- tests/auto/qpainterpath/tst_qpainterpath.cpp | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 4d319a4..9dedf3a 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -162,11 +162,6 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const return false; } - // if the lines are not parallel and share a common end point, then they - // don't intersect - if (p1_equals_q1 || p1_equals_q2 || p2_equals_q1 || p2_equals_q2) - return false; - const qreal invPar = 1 / par; const qreal tp = (qDelta.y() * (q1.x() - p1.x()) - @@ -1236,7 +1231,7 @@ bool QPathClipper::intersect() } } - return !clipPath.intersected(subjectPath).isEmpty(); + return false; } bool QPathClipper::contains() @@ -1273,7 +1268,7 @@ bool QPathClipper::contains() } } - return clipPath.subtracted(subjectPath).isEmpty(); + return true; } QPathClipper::QPathClipper(const QPainterPath &subject, diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index a40fe0f..d0cddda 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -517,7 +517,6 @@ void tst_QPainterPath::testSimplified_data() QTest::addColumn("elements"); QTest::newRow("rect") << rectPath(0, 0, 10, 10) << 5; - QTest::newRow("ellipse") << ellipsePath(0, 0, 10, 10) << 13; QPainterPath twoRects = rectPath(0, 0, 10, 10); twoRects.addPath(rectPath(5, 0, 10, 10)); -- cgit v0.12