summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-31 16:49:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-03 12:41:46 +0200
commit437d5d30422014c0a6def06e432a41e3f2e5c4c5 (patch)
treecc2a1d6892131a6627ab879eea11df8ef17958f4 /basegfx
parent2a933f0b9444792c9a6b1273238d3c36ca590686 (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 'basegfx')
-rw-r--r--basegfx/source/matrix/b3dhommatrix.cxx15
1 files changed, 13 insertions, 2 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;
}