summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c77231)
raw | patch | inline | side by side (parent: 6c77231)
author | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 18 Jun 2008 02:13:41 +0000 (02:13 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 18 Jun 2008 02:13:41 +0000 (02:13 +0000) |
src/2geom/transforms.cpp | patch | blob | history | |
src/2geom/transforms.h | patch | blob | history |
index 0a27c31f64f30d80e0e882dcb00e13b37a682acc..b2f305d1856f7c07961bdc725e88158852cfee85 100644 (file)
--- a/src/2geom/transforms.cpp
+++ b/src/2geom/transforms.cpp
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 9529d8922f74e14bf12641b448e31934245abeeb..0e276bfc2aa21479f6226f045dee264461c6e16e 100644 (file)
--- a/src/2geom/transforms.h
+++ b/src/2geom/transforms.h
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]; }