diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-08-30 18:32:36 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-08-30 18:32:36 +0000 |
| commit | 13e73fa386cd7843d7079ec7c162ef43d15097c4 (patch) | |
| tree | ab4c7a4f76528e9139a85aa1c1267ecf2c6df8fe /src/2geom/matrix.cpp | |
| parent | updated Slovak (sk) translation in trunk (diff) | |
| download | inkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.tar.gz inkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.zip | |
Update to 2Geom rev. 1113
(bzr r3622)
Diffstat (limited to 'src/2geom/matrix.cpp')
| -rw-r--r-- | src/2geom/matrix.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/2geom/matrix.cpp b/src/2geom/matrix.cpp index f53795943..c0e64ad33 100644 --- a/src/2geom/matrix.cpp +++ b/src/2geom/matrix.cpp @@ -94,7 +94,7 @@ void Matrix::setExpansionY(double val) { double exp_y = expansionY(); if(!near(exp_y, 0.0)) { //TODO: best way to deal with it is to skip op? double coef = val / expansionY(); - for(unsigned i=2;i<4;i++) _c[i] *= coef; + for(unsigned i=2; i<4; i++) _c[i] *= coef; } } @@ -105,6 +105,8 @@ void Matrix::setIdentity() { _c[4] = 0.0; _c[5] = 0.0; } +//TODO: use eps + bool Matrix::isIdentity(Coord const eps) const { return near(_c[0], 1.0) && near(_c[1], 0.0) && near(_c[2], 0.0) && near(_c[3], 1.0) && @@ -151,6 +153,14 @@ bool Matrix::isRotation(Coord const eps) const { near(_c[0]*_c[0] + _c[1]*_c[1], 1.0); } +bool Matrix::onlyScaleAndTranslation(Coord const eps) const { + return near(_c[0], _c[3]) && near(_c[1], 0) && near(_c[2], 0); +} + +bool Matrix::flips() const { + return cross(xAxis(), yAxis()) > 0; +} + /** Returns the Scale/Rotate/skew part of the matrix without the translation part. */ Matrix Matrix::without_translation() const { return Matrix(_c[0], _c[1], _c[2], _c[3], 0, 0); |
