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 <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
aavit 2011-06-02 15:29:11 +02:00 committed by Qt by Nokia
parent 83747a8237
commit f1c49cd12d

View File

@ -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;