sd/source/ui/animations/CustomAnimationDialog.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
New commits: commit 666dc76e0426927c5f8e70fcfa5bce25171a0722 Author: Katarina Behrens <[email protected]> Date: Thu Nov 16 10:25:17 2017 +0100 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 <[email protected]> Reviewed-by: Katarina Behrens <[email protected]> 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 ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
