diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-06 17:35:51 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-06 17:35:51 +0000 |
| commit | 7a951d2db3f5694d3a836f90c9465ebe83aa523e (patch) | |
| tree | ba78ddf2db392295a9a69d2a62c566b2c9a0fa16 /src | |
| parent | Add listeners for when shapes used by text are changed. (diff) | |
| download | inkscape-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')
| -rw-r--r-- | src/2geom/conicsec.cpp | 4 | ||||
| -rw-r--r-- | src/2geom/conicsec.h | 4 | ||||
| -rw-r--r-- | src/2geom/ellipse.cpp | 11 | ||||
| -rw-r--r-- | src/2geom/elliptical-arc.cpp | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/src/2geom/conicsec.cpp b/src/2geom/conicsec.cpp index 1e821c38c..63e622181 100644 --- a/src/2geom/conicsec.cpp +++ b/src/2geom/conicsec.cpp @@ -193,7 +193,7 @@ D2<SBasis> RatQuad::hermite() const { return out; } - std::vector<SBasis> RatQuad::homogenous() const { + std::vector<SBasis> RatQuad::homogeneous() const { std::vector<SBasis> res(3, SBasis()); Bezier xt(P[0][0], P[1][0]*w, P[2][0]); bezier_to_sbasis(res[0],xt); @@ -549,7 +549,7 @@ xAx xAx::operator*(double const &b) const { RatQuad rq = RatQuad::fromPointsTangents(A, rot90(dA), B, C, rot90(dC)); return rq; - //std::vector<SBasis> hrq = rq.homogenous(); + //std::vector<SBasis> hrq = rq.homogeneous(); /*SBasis vertex_poly = evaluate_at(hrq[0], hrq[1], hrq[2]); std::vector<double> rts = roots(vertex_poly); for(unsigned i = 0; i < rts.size(); i++) { diff --git a/src/2geom/conicsec.h b/src/2geom/conicsec.h index 8b9b1f917..b84edc699 100644 --- a/src/2geom/conicsec.h +++ b/src/2geom/conicsec.h @@ -90,7 +90,7 @@ public: void split(RatQuad &a, RatQuad &b) const; D2<SBasis> hermite() const; - std::vector<SBasis> homogenous() const; + std::vector<SBasis> homogeneous() const; }; @@ -335,7 +335,7 @@ public: } /* - * Compute the centre of simmetry of the conic section when it exists, + * Compute the centre of symmetry of the conic section when it exists, * else it return an uninitialized boost::optional<Point> instance. */ boost::optional<Point> centre() const 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]); diff --git a/src/2geom/elliptical-arc.cpp b/src/2geom/elliptical-arc.cpp index b7d60fd17..f0a29b565 100644 --- a/src/2geom/elliptical-arc.cpp +++ b/src/2geom/elliptical-arc.cpp @@ -722,7 +722,7 @@ D2<SBasis> EllipticalArc::toSBasis() const return arc; } -// All operations that do not contain skew can be evaulated +// All operations that do not contain skew can be evaluated // without passing through the implicit form of the ellipse, // which preserves precision. |
