diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-08-14 20:54:48 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-08-14 20:54:48 +0000 |
| commit | 55d43e4e27e0ba58a47fad70957dfa989aa173ad (patch) | |
| tree | 2ccfbac1c50023d08ae32975c876fa2478c1ad2a /src/2geom/transforms.cpp | |
| parent | Fix for bug #1752113; added set_preview_widget_active(false) to FileSaveDialo... (diff) | |
| download | inkscape-55d43e4e27e0ba58a47fad70957dfa989aa173ad.tar.gz inkscape-55d43e4e27e0ba58a47fad70957dfa989aa173ad.zip | |
Commit LivePathEffect branch to trunk!
(disabled extension/internal/bitmap/*.* in build.xml to fix compilation)
(bzr r3472)
Diffstat (limited to 'src/2geom/transforms.cpp')
| -rw-r--r-- | src/2geom/transforms.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/2geom/transforms.cpp b/src/2geom/transforms.cpp new file mode 100644 index 000000000..8c0164338 --- /dev/null +++ b/src/2geom/transforms.cpp @@ -0,0 +1,48 @@ +#include "transforms.h" + +namespace Geom { + +Matrix operator*(Translate const &t, Scale const &s) { + Matrix ret(s); + ret[4] = t[X] * s[X]; + ret[5] = t[Y] * s[Y]; + return ret; +} + +Matrix operator*(Translate const &t, Rotate const &r) { + Matrix ret(r); + ret.setTranslation(t.vec * ret); + return ret; +} + +Matrix operator*(Scale const &s, Translate const &t) { + return Matrix(s[0], 0, + 0 , s[1], + t[0], t[1]); +} + +Matrix operator*(Scale const &s, Matrix const &m) { + Matrix ret(m); + ret[0] *= s[X]; + ret[1] *= s[X]; + ret[2] *= s[Y]; + ret[3] *= s[Y]; + return ret; +} + +Matrix operator*(Matrix const &m, Translate const &t) { + Matrix ret(m); + ret[4] += t[X]; + ret[5] += t[Y]; + return ret; +} + +Matrix operator*(Matrix const &m, Scale const &s) { + Matrix ret(m); + ret[0] *= s[X]; ret[1] *= s[Y]; + ret[2] *= s[X]; ret[3] *= s[Y]; + ret[4] *= s[X]; ret[5] *= s[Y]; + return ret; +} + +} |
