diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-31 16:49:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-03 12:41:46 +0200 |
commit | 437d5d30422014c0a6def06e432a41e3f2e5c4c5 (patch) | |
tree | cc2a1d6892131a6627ab879eea11df8ef17958f4 /drawinglayer | |
parent | 2a933f0b9444792c9a6b1273238d3c36ca590686 (diff) |
move identity checks into B3DHomMatrix::operator*=
and consequently simplify some call-sites
Change-Id: I301fc4c88fdfb8af75a348a41593a27f4c6567c5
Reviewed-on: https://gerrit.libreoffice.org/59916
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
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 |