diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-06-18 02:13:41 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-06-18 02:13:41 +0000 |
| commit | 8086024a530b8879b0add9a245f339c664b0690a (patch) | |
| tree | 6c82a534658b4fa7ba792932ef233b924ab600a3 /src | |
| parent | Temporary shortcut for LPEParallel in pen tool (diff) | |
| download | inkscape-8086024a530b8879b0add9a245f339c664b0690a.tar.gz inkscape-8086024a530b8879b0add9a245f339c664b0690a.zip | |
update 2geom
(bzr r5977)
Diffstat (limited to 'src')
| -rw-r--r-- | src/2geom/transforms.cpp | 6 | ||||
| -rw-r--r-- | src/2geom/transforms.h | 2 |
2 files changed, 7 insertions, 1 deletions
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]; } |
