summaryrefslogtreecommitdiffstats
path: root/src/2geom/ellipse.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-09-06 17:35:51 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-09-06 17:35:51 +0000
commit7a951d2db3f5694d3a836f90c9465ebe83aa523e (patch)
treeba78ddf2db392295a9a69d2a62c566b2c9a0fa16 /src/2geom/ellipse.cpp
parentAdd listeners for when shapes used by text are changed. (diff)
downloadinkscape-7a951d2db3f5694d3a836f90c9465ebe83aa523e.tar.gz
inkscape-7a951d2db3f5694d3a836f90c9465ebe83aa523e.zip
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
Diffstat (limited to 'src/2geom/ellipse.cpp')
-rw-r--r--src/2geom/ellipse.cpp11
1 files changed, 9 insertions, 2 deletions
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<ShapeIntersection> 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<ShapeIntersection> 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<ShapeIntersection> 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<ShapeIntersection> as = intersect(lines[li]);
std::vector<ShapeIntersection> bs = other.intersect(lines[li]);