incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reg...@apache.org
Subject svn commit: r1382021 - /incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx
Date Fri, 07 Sep 2012 13:33:05 GMT
Author: regina
Date: Fri Sep  7 13:33:04 2012
New Revision: 1382021

URL: http://svn.apache.org/viewvc?rev=1382021&view=rev
Log:
#i120642# expand target to maximum edge not to diagonal

Modified:
    incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx

Modified: incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx?rev=1382021&r1=1382020&r2=1382021&view=diff
==============================================================================
--- incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx (original)
+++ incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx Fri Sep  7 13:33:04 2012
@@ -200,11 +200,11 @@ namespace basegfx
         // add object expansion
         if(bSquare)
         {
-            const double fOriginalDiag(sqrt((fTargetSizeX * fTargetSizeX) + (fTargetSizeY
* fTargetSizeY)));
-            fTargetOffsetX -= (fOriginalDiag - fTargetSizeX) / 2.0;
-            fTargetOffsetY -= (fOriginalDiag - fTargetSizeY) / 2.0;
-            fTargetSizeX = fOriginalDiag;
-            fTargetSizeY = fOriginalDiag;
+            const double fSquareWidth((fTargetSizeX>fTargetSizeY) ? fTargetSizeX : fTargetSizeY);
+            fTargetOffsetX = fTargetOffsetX + fTargetSizeX / 2.0 - fSquareWidth / 2.0;
+            fTargetOffsetY = fTargetOffsetY + fTargetSizeY / 2.0 - fSquareWidth / 2.0;
+            fTargetSizeX = fSquareWidth;
+            fTargetSizeY = fSquareWidth;
         }    
 
         // add object expansion



Mime
View raw message