summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegina Henschel <regina@apache.org>2012-09-07 12:33:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-19 20:07:33 +0100
commitd3dde5d940d69d6b859fef3ff722e349d7d89c54 (patch)
treefd2b4b5bed0e12c655e079bdb1c6895d9b16b267
parent43c234b0481fe63b8c4823affad066c6362f5068 (diff)
Resolves: #i120642# expand target to maximum edge not to diagonal
(cherry picked from commit 2e1700bf4f7cf913c23d35f325a50d3aa25426cc) Change-Id: Ic27fb3b18f42667419765a6adca41e1df27561c2
-rw-r--r--basegfx/source/tools/gradienttools.cxx10
-rw-r--r--sd/qa/unit/data/xml/fdo64586_0.xml8
-rw-r--r--sd/qa/unit/data/xml/n758621_0.xml8
-rw-r--r--sd/qa/unit/data/xml/n758621_1.xml8
4 files changed, 17 insertions, 17 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index c45c335e9368..9587872f8995 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -193,11 +193,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
diff --git a/sd/qa/unit/data/xml/fdo64586_0.xml b/sd/qa/unit/data/xml/fdo64586_0.xml
index cd2b2da13127..bcfa520ebbeb 100644
--- a/sd/qa/unit/data/xml/fdo64586_0.xml
+++ b/sd/qa/unit/data/xml/fdo64586_0.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="1397" positionY="963" sizeX="25197" sizeY="3508" type="com.sun.star.presentation.TitleTextShape" fontHeight="44.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="3508" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="1397" positionY="963" sizeX="25197" sizeY="3507" type="com.sun.star.presentation.TitleTextShape" fontHeight="44.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="3507" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -10,11 +10,11 @@
<LineEnd/>
<Transformation>
<Line1 column1="25198.000000" column2="0.000000" column3="1397.000000"/>
- <Line2 column1="0.000000" column2="3509.000000" column3="963.000000"/>
+ <Line2 column1="0.000000" column2="3508.000000" column3="963.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1397" positionY="4912" sizeX="25197" sizeY="12181" type="com.sun.star.presentation.SubtitleShape" text="Blah" fontHeight="32.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="78" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="12103" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="1397" positionY="4912" sizeX="25197" sizeY="12180" type="com.sun.star.presentation.SubtitleShape" text="Blah" fontHeight="32.000000" fontColor="000000" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="78" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="12103" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -24,7 +24,7 @@
<LineEnd/>
<Transformation>
<Line1 column1="25198.000000" column2="0.000000" column3="1397.000000"/>
- <Line2 column1="0.000000" column2="12182.000000" column3="4912.000000"/>
+ <Line2 column1="0.000000" column2="12181.000000" column3="4912.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
diff --git a/sd/qa/unit/data/xml/n758621_0.xml b/sd/qa/unit/data/xml/n758621_0.xml
index 600d31c6647b..b569f2307eb4 100644
--- a/sd/qa/unit/data/xml/n758621_0.xml
+++ b/sd/qa/unit/data/xml/n758621_0.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="12042" positionY="1899" sizeX="12087" sizeY="9783" type="com.sun.star.presentation.TitleTextShape" fontHeight="60.000000" fontColor="004990" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="9523" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="12042" positionY="1899" sizeX="12087" sizeY="9782" type="com.sun.star.presentation.TitleTextShape" fontHeight="60.000000" fontColor="004990" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="9522" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -10,11 +10,11 @@
<LineEnd/>
<Transformation>
<Line1 column1="12088.000000" column2="0.000000" column3="12042.000000"/>
- <Line2 column1="0.000000" column2="9784.000000" column3="1899.000000"/>
+ <Line2 column1="0.000000" column2="9783.000000" column3="1899.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14176" positionY="13248" sizeX="9953" sizeY="3812" type="com.sun.star.presentation.SubtitleShape" fontHeight="36.000000" fontColor="92d050" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="3812" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14176" positionY="13248" sizeX="9953" sizeY="3811" type="com.sun.star.presentation.SubtitleShape" fontHeight="36.000000" fontColor="92d050" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="3811" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -24,7 +24,7 @@
<LineEnd/>
<Transformation>
<Line1 column1="9954.000000" column2="0.000000" column3="14176.000000"/>
- <Line2 column1="0.000000" column2="3813.000000" column3="13248.000000"/>
+ <Line2 column1="0.000000" column2="3812.000000" column3="13248.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
diff --git a/sd/qa/unit/data/xml/n758621_1.xml b/sd/qa/unit/data/xml/n758621_1.xml
index 7dd7f24be1b5..689cc0028132 100644
--- a/sd/qa/unit/data/xml/n758621_1.xml
+++ b/sd/qa/unit/data/xml/n758621_1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="1485" positionY="608" sizeX="18411" sizeY="2209" type="com.sun.star.presentation.TitleTextShape" fontHeight="40.000000" fontColor="ff0000" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1949" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="1485" positionY="629" sizeX="18411" sizeY="2166" type="com.sun.star.presentation.TitleTextShape" fontHeight="40.000000" fontColor="ff0000" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1906" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -10,11 +10,11 @@
<LineEnd/>
<Transformation>
<Line1 column1="18412.000000" column2="0.000000" column3="1485.000000"/>
- <Line2 column1="0.000000" column2="2210.000000" column3="608.000000"/>
+ <Line2 column1="0.000000" column2="2167.000000" column3="629.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1692" positionY="4444" sizeX="22217" sizeY="12313" type="com.sun.star.presentation.OutlinerShape" fontHeight="24.000000" fontColor="000000" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="AUTOFIT" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="12063" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="1692" positionY="4444" sizeX="22217" sizeY="12312" type="com.sun.star.presentation.OutlinerShape" fontHeight="24.000000" fontColor="000000" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="AUTOFIT" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="130" textLowerDistance="130" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="12062" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465af" distance="20" angle="0"/>
@@ -24,7 +24,7 @@
<LineEnd/>
<Transformation>
<Line1 column1="22218.000000" column2="0.000000" column3="1692.000000"/>
- <Line2 column1="0.000000" column2="12314.000000" column3="4444.000000"/>
+ <Line2 column1="0.000000" column2="12313.000000" column3="4444.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>