summaryrefslogtreecommitdiffstats
path: root/src/2geom
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-05-05 08:45:33 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-05-05 08:45:33 +0000
commite3d114cbca503194d41fc8edb86848ea03074089 (patch)
tree0019498d47ccb79f7a6f447b8a0f468372006bb7 /src/2geom
parentadding Vinícius work whith node tips (diff)
parentDocumentation. Elements of design tutorial update ((not fully translated); Up... (diff)
downloadinkscape-e3d114cbca503194d41fc8edb86848ea03074089.tar.gz
inkscape-e3d114cbca503194d41fc8edb86848ea03074089.zip
update to trunk
(bzr r11950.1.340)
Diffstat (limited to 'src/2geom')
-rw-r--r--src/2geom/ellipse.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/2geom/ellipse.cpp b/src/2geom/ellipse.cpp
index bea99e5dd..2686844b2 100644
--- a/src/2geom/ellipse.cpp
+++ b/src/2geom/ellipse.cpp
@@ -36,6 +36,7 @@
#include <2geom/numeric/fitting-tool.h>
#include <2geom/numeric/fitting-model.h>
+using std::swap;
namespace Geom
{
@@ -102,7 +103,7 @@ void Ellipse::set(double A, double B, double C, double D, double E, double F)
// the solution is not unique so we choose always the ellipse
// with a rotation angle between 0 and PI/2
- if ( swap_axes ) std::swap(rx, ry);
+ if ( swap_axes ) swap(rx, ry);
if ( are_near(rot, M_PI/2)
|| are_near(rot, -M_PI/2)
|| are_near(rx, ry) )
@@ -233,7 +234,7 @@ Ellipse Ellipse::transformed(Affine const& m) const
Point new_center = center() * m;
Affine M = m.withoutTranslation();
Affine AM = A * M;
- if ( are_near(AM.det(), 0) )
+ if ( are_near(std::sqrt(fabs(AM.det())), 0) )
{
double angle;
if (AM[0] != 0)
@@ -262,7 +263,7 @@ Ellipse Ellipse::transformed(Affine const& m) const
Affine invm = M.inverse();
Q = invm * Q ;
- std::swap( invm[1], invm[2] );
+ swap( invm[1], invm[2] );
Q *= invm;
Ellipse e(Q[0], 2*Q[1], Q[3], 0, 0, -1);
e.m_centre = new_center;