summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2018-10-24 15:09:40 +0000
committerJabiertxof <jabier.arraiza@marker.es>2018-10-25 07:48:24 +0000
commitd1a433541404783eb5bf87caf20b8484808a8c1b (patch)
tree4b2883fa8fa0307e1a114f0776e9bdea39a1ee69 /src
parentFixing coding style (diff)
downloadinkscape-d1a433541404783eb5bf87caf20b8484808a8c1b.tar.gz
inkscape-d1a433541404783eb5bf87caf20b8484808a8c1b.zip
Fix closing issues
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-knot.cpp16
-rw-r--r--src/object/sp-ellipse.cpp13
2 files changed, 18 insertions, 11 deletions
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index 431021ad0..36f6f7a66 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -49,13 +49,17 @@ public:
static Geom::Path::size_type size_nondegenerate(Geom::Path const &path) {
- Geom::Path::size_type retval = path.size_open();
-
- // if path is closed and closing segment is not degenerate
- if (path.closed() && !path.back_closed().isDegenerate()) {
- retval = path.size_closed();
+ Geom::Path::size_type retval = path.size_default();
+ const Geom::Curve &closingline = path.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!
+ retval = path.size_open();
}
-
return retval;
}
diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp
index daa3148ef..3007558e7 100644
--- a/src/object/sp-ellipse.cpp
+++ b/src/object/sp-ellipse.cpp
@@ -461,11 +461,14 @@ void SPGenericEllipse::set_shape()
if (this->_isSlice() && this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_SLICE) {
pb.lineTo(Geom::Point(0, 0));
}
- if ( !(this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_ARC) ) {
- pb.closePath();
- } else {
- pb.flush();
- }
+// If convert to paths ellipses become unclosed so comment this and call "closePath"
+// Remove later
+// if ( !(this->arc_type == SP_GENERIC_ELLIPSE_ARC_TYPE_ARC) ) {
+// pb.closePath();
+// } else {
+// pb.flush();
+// }
+ pb.closePath();
c = new SPCurve(pb.peek());
// gchar *str = sp_svg_write_path(curve->get_pathvector());