summaryrefslogtreecommitdiffstats
path: root/src/2geom/elliptical-arc.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-01-12 23:25:39 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-01-12 23:25:39 +0000
commit5eb9b4815a12cc0dafd07905f7715a7e15a92b41 (patch)
treef39f5ae5a40012fa010402611d2b133553c22335 /src/2geom/elliptical-arc.cpp
parentLPE: rename function getHelperPaths --> getCanvasIndicators (the function is ... (diff)
downloadinkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.tar.gz
inkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.zip
update 2geom's copy to r2142
(bzr r12921)
Diffstat (limited to 'src/2geom/elliptical-arc.cpp')
-rw-r--r--src/2geom/elliptical-arc.cpp12
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]));