From f1c49cd12d707901192648b41b4fc0d76660acd8 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 2 Jun 2011 15:29:11 +0200 Subject: Fix problem with cosmetic stroking of cubic beziers The new algorithm would fail if the start and end point were identical. (cherry picked from commit 43ce5bab32e0d28366317be99df5e6df70787826) Change-Id: I44c42b190db95b831fd04492e4afe3555fb3db50 Reviewed-on: http://codereview.qt.nokia.com/610 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 47a1359288..cdc0978ed7 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -663,8 +663,8 @@ void QCosmeticStroker::renderCubicSubdivision(QCosmeticStroker::PointF *points, qreal dy = points[3].y - points[0].y; qreal len = ((qreal).25) * (qAbs(dx) + qAbs(dy)); - if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) > len || - qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) > len) { + if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) >= len || + qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) >= len) { splitCubic(points); --level; -- cgit v1.2.3