From 7a951d2db3f5694d3a836f90c9465ebe83aa523e Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Fri, 6 Sep 2019 19:35:51 +0200 Subject: Update 2geom Now at https://gitlab.com/inkscape/lib2geom/commit/5eb3544738724087f3b53e047df5a8ead3549e8b Fixes https://bugs.launchpad.net/inkscape/+bug/1525498 and possibly https://gitlab.com/inkscape/inkscape/issues/194 --- src/2geom/ellipse.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/2geom/ellipse.cpp') diff --git a/src/2geom/ellipse.cpp b/src/2geom/ellipse.cpp index f4704460f..26d13248c 100644 --- a/src/2geom/ellipse.cpp +++ b/src/2geom/ellipse.cpp @@ -536,6 +536,7 @@ std::vector Ellipse::intersect(Ellipse const &other) const Coord ee = mu * E + e; Coord ff = mu * F + f; + unsigned line_num = 0; Line lines[2]; if (aa != 0) { @@ -545,6 +546,7 @@ std::vector Ellipse::intersect(Ellipse const &other) const Coord alpha = (dd - cc*q) / (s - q); Coord beta = cc - alpha; + line_num = 2; lines[0] = Line(1, q, alpha); lines[1] = Line(1, s, beta); } else if (bb != 0) { @@ -554,15 +556,20 @@ std::vector Ellipse::intersect(Ellipse const &other) const Coord alpha = cc / ee; Coord beta = ff * ee / cc; + line_num = 2; lines[0] = Line(q, 1, alpha); lines[1] = Line(s, 1, beta); - } else { + } else if (ee != 0) { + line_num = 2; lines[0] = Line(ee, 0, dd); lines[1] = Line(0, 1, cc/ee); + } else if (cc != 0 || dd != 0) { + line_num = 1; + lines[0] = Line(cc, dd, ff); } // intersect with the obtained lines and report intersections - for (unsigned li = 0; li < 2; ++li) { + for (unsigned li = 0; li < line_num; ++li) { std::vector as = intersect(lines[li]); std::vector bs = other.intersect(lines[li]); -- cgit v1.2.3