openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1482740 - /openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
Date Wed, 15 May 2013 09:51:22 GMT
Author: alg
Date: Wed May 15 09:51:21 2013
New Revision: 1482740

URL: http://svn.apache.org/r1482740
Log:
i121801 Corrected objectBoundingBox case for GradientTransform

Modified:
    openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx

Modified: openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx?rev=1482740&r1=1482739&r2=1482740&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx Wed May
15 09:51:21 2013
@@ -413,15 +413,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
                 {
@@ -433,11 +437,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
@@ -750,14 +754,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
                 {
@@ -769,11 +776,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



Mime
View raw message