[Libreoffice-commits] core.git: drawinglayer/source
Armin Le Grand
alg at apache.org
Mon Jun 17 06:44:59 PDT 2013
drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 41 +++++++------
1 file changed, 24 insertions(+), 17 deletions(-)
New commits:
commit e0d8fb0cb157668dffa683fe81418304f8a843dd
Author: Armin Le Grand <alg at apache.org>
Date: Wed May 15 09:51:21 2013 +0000
Related: #i121801# Corrected objectBoundingBox case for GradientTransform
(cherry picked from commit f03ec4812cfe71f582c5290869f22eadd661b48a)
Change-Id: Icb3e2cefda2fd5fe9a2dcf501e5e07881961932e
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 756f7b0..66d21f0 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -408,15 +408,19 @@ namespace drawinglayer
// gradient vector defined by Start,End
const basegfx::B2DVector aVector(getEnd() - getStart());
const double fVectorLength(aVector.getLength());
- basegfx::B2DHomMatrix aUnitGradientToGradient;
- aUnitGradientToGradient.scale(fVectorLength, 1.0);
- aUnitGradientToGradient.rotate(atan2(aVector.getY(), aVector.getX()));
- aUnitGradientToGradient.translate(getStart().getX(), getStart().getY());
+ aUnitGradientToObject.scale(fVectorLength, 1.0);
+ aUnitGradientToObject.rotate(atan2(aVector.getY(), aVector.getX()));
+ aUnitGradientToObject.translate(getStart().getX(), getStart().getY());
+
+ if(!getGradientTransform().isIdentity())
+ {
+ aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ }
// create full transform from unit gradient coordinates to object coordinates
// including the SvgGradient transformation
- aUnitGradientToObject = aObjectTransform * aUnitGradientToGradient;
+ aUnitGradientToObject = aObjectTransform * aUnitGradientToObject;
}
else
{
@@ -428,11 +432,11 @@ namespace drawinglayer
aUnitGradientToObject.scale(aVector.getLength(), 1.0);
aUnitGradientToObject.rotate(atan2(aVector.getY(), aVector.getX()));
aUnitGradientToObject.translate(aStart.getX(), aStart.getY());
- }
- if(!getGradientTransform().isIdentity())
- {
- aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ if(!getGradientTransform().isIdentity())
+ {
+ aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ }
}
// create inverse from it
@@ -745,14 +749,17 @@ namespace drawinglayer
{
// interpret in unit coordinate system -> object aspect ratio will scale result
// create unit transform from unit vector to given linear gradient vector
- basegfx::B2DHomMatrix aUnitGradientToGradient;
+ aUnitGradientToObject.scale(getRadius(), getRadius());
+ aUnitGradientToObject.translate(getStart().getX(), getStart().getY());
- aUnitGradientToGradient.scale(getRadius(), getRadius());
- aUnitGradientToGradient.translate(getStart().getX(), getStart().getY());
+ if(!getGradientTransform().isIdentity())
+ {
+ aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ }
// create full transform from unit gradient coordinates to object coordinates
// including the SvgGradient transformation
- aUnitGradientToObject = aObjectTransform * aUnitGradientToGradient;
+ aUnitGradientToObject = aObjectTransform * aUnitGradientToObject;
}
else
{
@@ -764,11 +771,11 @@ namespace drawinglayer
aUnitGradientToObject.scale(fRadius, fRadius);
aUnitGradientToObject.translate(aStart.getX(), aStart.getY());
- }
- if(!getGradientTransform().isIdentity())
- {
- aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ if(!getGradientTransform().isIdentity())
+ {
+ aUnitGradientToObject = getGradientTransform() * aUnitGradientToObject;
+ }
}
// create inverse from it
More information about the Libreoffice-commits
mailing list