summaryrefslogtreecommitdiff
path: root/basegfx/source/tools
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
commit7857f07d09265f58b2c17c4f619f4aad81b1c43d (patch)
treea88bc2ea43db41f9cb3a715651cfe77b477643f6 /basegfx/source/tools
parent1f0839c836781bc41f8c301b6262eabc978c90f8 (diff)
#i97509# continued matrix tooling and adapting the usages now to all the ooo code
Diffstat (limited to 'basegfx/source/tools')
-rw-r--r--basegfx/source/tools/gradienttools.cxx17
-rwxr-xr-xbasegfx/source/tools/unopolypolygon.cxx6
2 files changed, 9 insertions, 14 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index 9e78039cd590..51989899ebf4 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -32,9 +32,9 @@
#include "precompiled_basegfx.hxx"
#include <basegfx/tools/gradienttools.hxx>
-
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace basegfx
{
@@ -79,9 +79,8 @@ namespace basegfx
B2DPoint aCenter(0.5, 0.5);
aCenter *= o_rGradientInfo.maTextureTransform;
- o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY());
- o_rGradientInfo.maTextureTransform.rotate(fAngle);
- o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY());
+ o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle)
+ * o_rGradientInfo.maTextureTransform;
}
// add object translate
@@ -158,9 +157,8 @@ namespace basegfx
B2DPoint aCenter(0.5, 0.5);
aCenter *= o_rGradientInfo.maTextureTransform;
- o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY());
- o_rGradientInfo.maTextureTransform.rotate(fAngle);
- o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY());
+ o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle)
+ * o_rGradientInfo.maTextureTransform;
}
}
@@ -232,9 +230,8 @@ namespace basegfx
B2DPoint aCenter(0.5, 0.5);
aCenter *= o_rGradientInfo.maTextureTransform;
- o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY());
- o_rGradientInfo.maTextureTransform.rotate(fAngle);
- o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY());
+ o_rGradientInfo.maTextureTransform = basegfx::tools::createRotateAroundPoint(aCenter, fAngle)
+ * o_rGradientInfo.maTextureTransform;
}
// add defined offsets after rotation
diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx
index 6d8fcd83edb0..05dbe5b1c823 100755
--- a/basegfx/source/tools/unopolypolygon.cxx
+++ b/basegfx/source/tools/unopolypolygon.cxx
@@ -44,8 +44,8 @@
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-
#include <basegfx/tools/unopolypolygon.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
using namespace ::com::sun::star;
@@ -138,9 +138,7 @@ namespace unotools
if( !aOffset.equalZero() )
{
- B2DHomMatrix aTranslate;
- aTranslate.translate( aOffset.getX(), aOffset.getY() );
-
+ const B2DHomMatrix aTranslate(tools::createTranslateB2DHomMatrix(aOffset));
aSrcPoly.transform( aTranslate );
}