summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-11-16 10:25:17 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-11-17 11:09:42 +0100
commit666dc76e0426927c5f8e70fcfa5bce25171a0722 (patch)
tree2b58493481f97aa8a6044341f13a8254eecc1666
parentb8b5baefa9ead7a3360e0249224fd9beaa9b2bb0 (diff)
tdf#108450: The shrink part of grow/shrink animation finally works
this automagically fixes also ODF export i.e. shrink to 25% in both directions gets saved as smil:by="-0.75,-0.75" Change-Id: I977deefb11cc4baa6a3caac5c9774940b5bc047e Reviewed-on: https://gerrit.libreoffice.org/44814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 4c9f3a59ee82..28f96d559121 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -828,6 +828,15 @@ void ScalePropertyBox::setValue( const Any& rValue, const OUString& )
else
mnDirection = 3;
+ // Shrink animation is represented by negative value
+ // Shrink factor is calculated as (1 + $fValue)
+ // e.g 1 + (-0.75) = 0.25 => shrink to 25% of the size
+ // 0.25 = -0.75 + 1
+ if ( fValue1 < 0.0 )
+ fValue1 += 1;
+ if ( fValue2 < 0.0 )
+ fValue2 += 1;
+
long nValue;
if( fValue1 )
nValue = (long)(fValue1 * 100.0);
@@ -841,6 +850,14 @@ void ScalePropertyBox::setValue( const Any& rValue, const OUString& )
Any ScalePropertyBox::getValue()
{
double fValue1 = (double)mpMetric->GetValue() / 100.0;
+
+ // Shrink animation is represented by value < 1 (< 100%)
+ // Shrink factor is calculated as (1 + $fValue)
+ // e.g shrink to 25% of the size: 0.25 = 1 + $fValue =>
+ // $fValue = -0.75; -0.75 = 0.25 -1
+ if ( fValue1 < 1.0 )
+ fValue1 -= 1;
+
double fValue2 = fValue1;
if( mnDirection == 1 )