incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1382027 - /incubator/ooo/trunk/main/basegfx/source/tools/gradienttools.cxx
Date Fri, 07 Sep 2012 13:52:41 GMT
Author: alg
Date: Fri Sep  7 13:52:40 2012
New Revision: 1382027

URL: http://svn.apache.org/viewvc?rev=1382027&view=rev
Log:
#120642# streamlined a little bit

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=1382027&r1=1382026&r2=1382027&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:52:40 2012
@@ -200,11 +200,10 @@ namespace basegfx
         // add object expansion
         if(bSquare)
         {
-            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;
+            const double fSquareWidth(std::max(fTargetSizeX, fTargetSizeY));
+            fTargetOffsetX -= (fSquareWidth - fTargetSizeX) / 2.0;
+            fTargetOffsetY -= (fSquareWidth - fTargetSizeY) / 2.0;
+            fTargetSizeX = fTargetSizeY = fSquareWidth;
         }    
 
         // add object expansion



Mime
View raw message