diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-02 16:29:13 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-02 16:29:13 +0000 |
commit | 28fb0d5ab394ac154a51bfb7951487c7dd7421cc (patch) | |
tree | b449fce5dc3ffc8d17c7304c21e931ce0da2affe | |
parent | 57b4e1cf6792105a921312ff741337eb49dde442 (diff) |
INTEGRATION: CWS aw052 (1.40.90); FILE MERGED
2007/07/26 10:56:28 aw 1.40.90.3: RESYNC: (1.41-1.43); FILE MERGED
2007/07/05 23:27:51 aw 1.40.90.2: RESYNC: (1.40-1.41); FILE MERGED
2007/06/26 16:37:03 aw 1.40.90.1: #i78696# changed handling of rotation contained in transformation to mathematically correct orientation
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 2632088ec0ab..4e0487563b91 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: svdoashp.cxx,v $ * - * $Revision: 1.43 $ + * $Revision: 1.44 $ * - * last change: $Author: obo $ $Date: 2007-07-18 10:57:06 $ + * last change: $Author: hr $ $Date: 2007-08-02 17:29:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -3755,7 +3755,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, SetSnapRect(aBaseRect); // shear? -// if(0.0 != fShearX) +// if(!basegfx::fTools::equalZero(fShearX)) // { // GeoStat aGeoStat; // aGeoStat.nShearWink = FRound((atan(fShearX) / F_PI180) * 100.0); @@ -3764,16 +3764,20 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // } // rotation? - if(0.0 != fRotate) + if(!basegfx::fTools::equalZero(fRotate)) { GeoStat aGeoStat; - aGeoStat.nDrehWink = FRound((fRotate / F_PI180) * 100.0); + + // #i78696# + // fRotate is mathematically correct, but aGeoStat.nDrehWink is + // mirrored -> mirror value here + aGeoStat.nDrehWink = NormAngle360(FRound(-fRotate / F_PI18000)); aGeoStat.RecalcSinCos(); Rotate(Point(), aGeoStat.nDrehWink, aGeoStat.nSin, aGeoStat.nCos); } // translate? - if(0.0 != aTranslate.getX() || 0.0 != aTranslate.getY()) + if(!aTranslate.equalZero()) { Move(Size(FRound(aTranslate.getX()), FRound(aTranslate.getY()))); } @@ -3884,22 +3888,26 @@ sal_Bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, ba // build matrix rMatrix.identity(); - if(1.0 != aScale.getX() || 1.0 != aScale.getY()) + if(!basegfx::fTools::equal(aScale.getX(), 1.0) || !basegfx::fTools::equal(aScale.getY(), 1.0)) { rMatrix.scale(aScale.getX(), aScale.getY()); } - if(0.0 != fShearX) + if(!basegfx::fTools::equalZero(fShearX)) { rMatrix.shearX(tan(fShearX)); } - if(0.0 != fRotate) + if(!basegfx::fTools::equalZero(fRotate)) { - rMatrix.rotate(fRotate); + // #i78696# + // fRotate is from the old GeoStat struct and thus mathematically wrong orientated. For + // the linear combination of matrices it needed to be fixed in the API, so it needs to + // be mirrored here + rMatrix.rotate(-fRotate); } - if(0.0 != aTranslate.getX() || 0.0 != aTranslate.getY()) + if(!aTranslate.equalZero()) { rMatrix.translate(aTranslate.getX(), aTranslate.getY()); } |