diff options
-rw-r--r-- | basegfx/source/matrix/b3dhommatrix.cxx | 15 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 14 |
3 files changed, 19 insertions, 27 deletions
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index d23aed896120..e3f3d3d28475 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -117,9 +117,20 @@ namespace basegfx B3DHomMatrix& B3DHomMatrix::operator*=(const B3DHomMatrix& rMat) { - if(!rMat.isIdentity()) + if(rMat.isIdentity()) + { + // multiply with identity, no change -> nothing to do + } + else if(isIdentity()) + { + // we are identity, result will be rMat -> assign + *this = rMat; + } + else + { + // multiply mpImpl->doMulMatrix(*rMat.mpImpl); - + } return *this; } diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx index 12eef36c16ac..6e2ab2e16b3e 100644 --- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx @@ -404,14 +404,11 @@ namespace drawinglayer aUnitGradientToObject.rotate(atan2(aVector.getY(), aVector.getX())); aUnitGradientToObject.translate(getStart().getX(), getStart().getY()); - if(!getGradientTransform().isIdentity()) - { - aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject; - } + aUnitGradientToObject *= getGradientTransform(); // create full transform from unit gradient coordinates to object coordinates // including the SvgGradient transformation - aUnitGradientToObject = aObjectTransform * aUnitGradientToObject; + aUnitGradientToObject *= aObjectTransform; } else { @@ -424,10 +421,7 @@ namespace drawinglayer aUnitGradientToObject.rotate(atan2(aVector.getY(), aVector.getX())); aUnitGradientToObject.translate(aStart.getX(), aStart.getY()); - if(!getGradientTransform().isIdentity()) - { - aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject; - } + aUnitGradientToObject *= getGradientTransform(); } // create inverse from it @@ -757,10 +751,7 @@ namespace drawinglayer aUnitGradientToObject.scale(fRadius, fRadius); aUnitGradientToObject.translate(aStart.getX(), aStart.getY()); - if(!getGradientTransform().isIdentity()) - { - aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject; - } + aUnitGradientToObject *= getGradientTransform(); } // create inverse from it diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index cdce7870a536..bc41904eea2c 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -274,18 +274,8 @@ void TransformableSwFrame::restoreFrameAreas() // transform by given B2DHomMatrix void TransformableSwFrame::transform(const basegfx::B2DHomMatrix aTransform) { - if(!aTransform.isIdentity()) - { - if(!maFrameAreaTransformation.isIdentity()) - { - maFrameAreaTransformation *= aTransform; - } - - if(!maFramePrintAreaTransformation.isIdentity()) - { - maFramePrintAreaTransformation *= aTransform; - } - } + maFrameAreaTransformation *= aTransform; + maFramePrintAreaTransformation *= aTransform; } SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib ) |