diff options
Diffstat (limited to 'src/2geom/elliptical-arc.cpp')
| -rw-r--r-- | src/2geom/elliptical-arc.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/2geom/elliptical-arc.cpp b/src/2geom/elliptical-arc.cpp index d2cb0b707..c96d5f1a6 100644 --- a/src/2geom/elliptical-arc.cpp +++ b/src/2geom/elliptical-arc.cpp @@ -115,9 +115,11 @@ Rect EllipticalArc::boundsExact() const if ( arc_extremes[2] < arc_extremes[3] ) std::swap(arc_extremes[2], arc_extremes[3]); - for (unsigned i = 0; i < 4; ++i) { - if (containsAngle(extremes[i])) { - arc_extremes[i] = valueAtAngle(extremes[i], (i >> 1) ? Y : X); + if ( !are_near(initialPoint(), finalPoint()) ) { + for (unsigned i = 0; i < 4; ++i) { + if (containsAngle(extremes[i])) { + arc_extremes[i] = valueAtAngle(extremes[i], (i >> 1) ? Y : X); + } } } @@ -264,7 +266,7 @@ std::vector<Coord> EllipticalArc::roots(Coord v, Dim2 d) const } double rotx, roty; - sincos(_rot_angle, roty, rotx); + sincos(_rot_angle, roty, rotx); /// \todo sin and cos are calculated in many places in this function, optimize this a bit! if (d == X) roty = -roty; double rxrotx = ray(X) * rotx; @@ -569,7 +571,7 @@ std::vector<double> EllipticalArc::allNearestPoints( Point const& p, double from double mindistsq1 = std::numeric_limits<double>::max(); double mindistsq2 = std::numeric_limits<double>::max(); double dsq; - unsigned int mi1, mi2; + unsigned int mi1 = 0, mi2 = 0; for ( unsigned int i = 0; i < real_sol.size(); ++i ) { dsq = distanceSq(p, pointAtAngle(real_sol[i])); |
