From: johanengelen Date: Wed, 26 Aug 2009 22:36:23 +0000 (+0000) Subject: lpe-spiro: fix problem with rounding and very nearly zero closing line segments X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bed59c3d93d592c052b7863c9ef395e5cb7c8d7b;p=inkscape.git lpe-spiro: fix problem with rounding and very nearly zero closing line segments --- 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(); }