From b2767f2f915bdbda8b80e0373a3b6c1d74c0a0fb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 26 Aug 2009 22:36:23 +0000 Subject: lpe-spiro: fix problem with rounding and very nearly zero closing line segments (bzr r8541) --- src/live_effects/lpe-spiro.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/live_effects/lpe-spiro.cpp b/src/live_effects/lpe-spiro.cpp index 72b77622d..794fd980e 100644 --- a/src/live_effects/lpe-spiro.cpp +++ b/src/live_effects/lpe-spiro.cpp @@ -158,7 +158,9 @@ LPESpiro::doEffect(SPCurve * curve) Geom::Path::const_iterator curve_endit = path_it->end_default(); // this determines when the loop has to stop if (path_it->closed()) { // if the path is closed, maybe we have to stop a bit earlier because the closing line segment has zerolength. - if (path_it->back_closed().isDegenerate()) { + const Geom::Curve &closingline = path_it->back_closed(); // the closing line segment is always of type Geom::LineSegment. + if (are_near(closingline.initialPoint(), closingline.finalPoint())) { + // closingline.isDegenerate() did not work, because it only checks for *exact* zero length, which goes wrong for relative coordinates and rounding errors... // the closing line segment has zero-length. So stop before that one! curve_endit = path_it->end_open(); } -- cgit v1.2.3