From: cilix42 Date: Wed, 18 Jun 2008 02:13:41 +0000 (+0000) Subject: update 2geom X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c325659c5498684f90d96fc36b16ed0d3a906a87;p=inkscape.git update 2geom --- diff --git a/src/2geom/transforms.cpp b/src/2geom/transforms.cpp index 0a27c31f6..b2f305d18 100644 --- a/src/2geom/transforms.cpp +++ b/src/2geom/transforms.cpp @@ -45,6 +45,12 @@ Matrix operator*(Matrix const &m, Scale const &s) { return ret; } +Matrix operator*(Matrix const &m, Rotate const &r) { + Matrix ret(m); + ret *= (Matrix) r; + return ret; +} + Translate pow(Translate const &t, int n) { return Translate(t[0]*n, t[1]*n); } diff --git a/src/2geom/transforms.h b/src/2geom/transforms.h index 9529d8922..0e276bfc2 100644 --- a/src/2geom/transforms.h +++ b/src/2geom/transforms.h @@ -82,7 +82,7 @@ class Rotate { explicit Rotate(Coord theta) : vec(std::cos(theta), std::sin(theta)) {} Rotate(Point const &p) {Point v = p; v.normalize(); vec = v;} //TODO: UGLY! explicit Rotate(Coord x, Coord y) { Rotate(Point(x, y)); } - inline operator Matrix() const { return Matrix(vec[X], vec[Y], vec[Y], -vec[X], 0, 0); } + inline operator Matrix() const { return Matrix(vec[X], -vec[Y], vec[Y], vec[X], 0, 0); } inline Coord operator[](Dim2 const dim) const { return vec[dim]; } inline Coord operator[](unsigned const dim) const { return vec[dim]; }