diff options
author | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2009-09-22 18:14:05 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2009-09-22 18:14:05 +0200 |
commit | 7857f07d09265f58b2c17c4f619f4aad81b1c43d (patch) | |
tree | a88bc2ea43db41f9cb3a715651cfe77b477643f6 /canvas/source/tools | |
parent | 1f0839c836781bc41f8c301b6262eabc978c90f8 (diff) |
#i97509# continued matrix tooling and adapting the usages now to all the ooo code
Diffstat (limited to 'canvas/source/tools')
-rw-r--r-- | canvas/source/tools/canvastools.cxx | 11 | ||||
-rw-r--r-- | canvas/source/tools/surface.cxx | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 23d6124e4cb8..278789637c72 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -63,6 +63,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/tools/canvastools.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppuhelper/compbase1.hxx> #include <rtl/instance.hxx> @@ -679,9 +680,8 @@ namespace canvas i_transformation ); // now move resulting left,top point of bounds to (0,0) - ::basegfx::B2DHomMatrix aCorrectedTransform; - aCorrectedTransform.translate( -aTransformedRect.getMinX(), - -aTransformedRect.getMinY() ); + const basegfx::B2DHomMatrix aCorrectedTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTransformedRect.getMinX(), -aTransformedRect.getMinY())); // prepend to original transformation o_transform = aCorrectedTransform * i_transformation; @@ -745,9 +745,8 @@ namespace canvas transformation ); // now move resulting left,top point of bounds to (0,0) - ::basegfx::B2DHomMatrix aCorrectedTransform; - aCorrectedTransform.translate( -aTransformedRect.getMinX(), - -aTransformedRect.getMinY() ); + basegfx::B2DHomMatrix aCorrectedTransform(basegfx::tools::createTranslateB2DHomMatrix( + -aTransformedRect.getMinX(), -aTransformedRect.getMinY())); // scale to match outRect const double xDenom( aTransformedRect.getWidth() ); diff --git a/canvas/source/tools/surface.cxx b/canvas/source/tools/surface.cxx index c3161758ea3e..96162f6d78af 100644 --- a/canvas/source/tools/surface.cxx +++ b/canvas/source/tools/surface.cxx @@ -33,6 +33,7 @@ #include "surface.hxx" #include <basegfx/polygon/b2dpolygonclipper.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <comphelper/scopeguard.hxx> #include <boost/bind.hpp> @@ -150,9 +151,8 @@ namespace canvas // 4) scale to normalized device coordinates // 5) flip y-axis // 6) translate to account for viewport transform - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate(maSourceOffset.getX(), - maSourceOffset.getY()); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + maSourceOffset.getX(), maSourceOffset.getY())); aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); @@ -277,8 +277,7 @@ namespace canvas // 1) offset of surface subarea // 2) surface transform // 3) translation to output position [rPos] - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate(aPos1.getX(),aPos1.getY()); + basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(aPos1.getX(), aPos1.getY())); aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); @@ -380,7 +379,7 @@ namespace canvas // be transformed by the overall transform and uv coordinates will // be calculated from the result, and this is why we need to use // integer coordinates here... - ::basegfx::B2DHomMatrix aTransform; + basegfx::B2DHomMatrix aTransform; aTransform = aTransform * rTransform; aTransform.translate(::basegfx::fround(rPos.getX()), ::basegfx::fround(rPos.getY())); |