diff options
author | Armin Le Grand <alg@apache.org> | 2012-09-07 12:52:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-19 20:07:33 +0100 |
commit | 38d02291f32d0f605a4046a96fd6c90abd935f6b (patch) | |
tree | 4aeb69099123a271954b3f8b93e27c36e342001e /basegfx/source/tools/gradienttools.cxx | |
parent | d3dde5d940d69d6b859fef3ff722e349d7d89c54 (diff) |
Related: #120642# streamlined a little bit
(cherry picked from commit d33d09be15d01ae74a9b895e6c17cba63f1f84ed)
Change-Id: I2646e27a017a37a517d1f82b281fa59794b635db
Diffstat (limited to 'basegfx/source/tools/gradienttools.cxx')
-rw-r--r-- | basegfx/source/tools/gradienttools.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index 9587872f8995..7bdc07d1441c 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -193,11 +193,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 |