diff options
author | Armin Le Grand <alg@apache.org> | 2012-10-02 08:23:25 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2012-10-02 08:23:25 +0000 |
commit | 05785d283e718aab182a5ea848de72e4a4b2efe3 (patch) | |
tree | 77644de10eaafff2bed544e0e70cc676961d95e8 /cppcanvas/source/mtfrenderer | |
parent | 94205034afa2abe9ab73b2f5d0c76f295a7889c9 (diff) |
#120604# unified and secured gradient tooling for primitives, adapted usages
Notes
Notes:
merged as: 385bb4547359027bca6d5158e00e541f094b277e
Diffstat (limited to 'cppcanvas/source/mtfrenderer')
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index d02bb0551b42..2a8e3dbd0950 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -688,14 +688,14 @@ namespace cppcanvas switch( rGradient.GetStyle() ) { case GRADIENT_LINEAR: - basegfx::tools::createLinearODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createLinearODFGradientInfo( aBounds, nSteps, fBorder, fRotation); // map odf to svg gradient orientation - x // instead of y direction - aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aRot90; + aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aRot90); aGradientService = rtl::OUString::createFromAscii("LinearGradient"); break; @@ -714,27 +714,27 @@ namespace cppcanvas // border value, hence the second (left // most 1-... const double fAxialBorder (1-2*(1-fBorder)); - basegfx::tools::createAxialODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createAxialODFGradientInfo( aBounds, nSteps, fAxialBorder, fRotation); // map odf to svg gradient orientation - x // instead of y direction - aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aRot90; + aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aRot90); // map odf axial gradient to 3-stop linear // gradient - shift left by 0.5 basegfx::B2DHomMatrix aShift; - aShift.translate(-0.5,0); - aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aShift; + aShift.translate(-0.5,0); + aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aShift); aGradientService = rtl::OUString::createFromAscii("LinearGradient"); break; } case GRADIENT_RADIAL: - basegfx::tools::createRadialODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createRadialODFGradientInfo( aBounds, aOffset, nSteps, @@ -743,7 +743,7 @@ namespace cppcanvas break; case GRADIENT_ELLIPTICAL: - basegfx::tools::createEllipticalODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createEllipticalODFGradientInfo( aBounds, aOffset, nSteps, @@ -753,7 +753,7 @@ namespace cppcanvas break; case GRADIENT_SQUARE: - basegfx::tools::createSquareODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createSquareODFGradientInfo( aBounds, aOffset, nSteps, @@ -763,7 +763,7 @@ namespace cppcanvas break; case GRADIENT_RECT: - basegfx::tools::createRectangularODFGradientInfo(aGradInfo, + aGradInfo = basegfx::tools::createRectangularODFGradientInfo( aBounds, aOffset, nSteps, @@ -785,10 +785,12 @@ namespace cppcanvas // gradient will always display at the origin, and // not within the polygon bound (which might be // miles away from the origin). - aGradInfo.maTextureTransform.translate( aBounds.getMinX(), - aBounds.getMinY() ); + aGradInfo.setTextureTransform( + basegfx::tools::createTranslateB2DHomMatrix( + aBounds.getMinX(), + aBounds.getMinY()) * aGradInfo.getTextureTransform()); ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform, - aGradInfo.maTextureTransform ); + aGradInfo.getTextureTransform() ); uno::Sequence<uno::Any> args(3); beans::PropertyValue aProp; @@ -799,7 +801,7 @@ namespace cppcanvas aProp.Value <<= aStops; args[1] <<= aProp; aProp.Name = rtl::OUString::createFromAscii("AspectRatio"); - aProp.Value <<= aGradInfo.mfAspectRatio; + aProp.Value <<= aGradInfo.getAspectRatio(); args[2] <<= aProp; aTexture.Gradient.set( |