tdf#96522 - [ANIMATION] Animation Spiral in does not work
blind fix for this since I cannot seem to make it work on my dev box no
matter how far back I go.
This seems to be a regression from commit
c7e8f21a53
"loplugin:unusedmethods"
Change-Id: I99f0f0ca662a5fe246057b1bb8da3bd3d3c7bac6
This commit is contained in:
@@ -141,6 +141,7 @@ public:
|
|||||||
value, or start fresh each time.
|
value, or start fresh each time.
|
||||||
*/
|
*/
|
||||||
FromToByActivity(
|
FromToByActivity(
|
||||||
|
const OptionalValueType& rFrom,
|
||||||
const OptionalValueType& rTo,
|
const OptionalValueType& rTo,
|
||||||
const OptionalValueType& rBy,
|
const OptionalValueType& rBy,
|
||||||
const ActivityParameters& rParms,
|
const ActivityParameters& rParms,
|
||||||
@@ -148,6 +149,9 @@ public:
|
|||||||
const Interpolator< ValueType >& rInterpolator,
|
const Interpolator< ValueType >& rInterpolator,
|
||||||
bool bCumulative )
|
bool bCumulative )
|
||||||
: BaseType( rParms ),
|
: BaseType( rParms ),
|
||||||
|
maFrom( rFrom ),
|
||||||
|
maTo( rTo ),
|
||||||
|
maBy( rBy ),
|
||||||
mpFormula( rParms.mpFormula ),
|
mpFormula( rParms.mpFormula ),
|
||||||
maStartValue(),
|
maStartValue(),
|
||||||
maEndValue(),
|
maEndValue(),
|
||||||
@@ -166,6 +170,74 @@ public:
|
|||||||
"From and one of To or By, or To or By alone must be valid" );
|
"From and one of To or By, or To or By alone must be valid" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void startAnimation()
|
||||||
|
{
|
||||||
|
if (this->isDisposed() || !mpAnim)
|
||||||
|
return;
|
||||||
|
BaseType::startAnimation();
|
||||||
|
|
||||||
|
// start animation
|
||||||
|
mpAnim->start( BaseType::getShape(),
|
||||||
|
BaseType::getShapeAttributeLayer() );
|
||||||
|
|
||||||
|
// setup start and end value. Determine animation
|
||||||
|
// start value only when animation actually
|
||||||
|
// started up (this order is part of the Animation
|
||||||
|
// interface contract)
|
||||||
|
const ValueType aAnimationStartValue( mpAnim->getUnderlyingValue() );
|
||||||
|
|
||||||
|
// first of all, determine general type of
|
||||||
|
// animation, by inspecting which of the FromToBy values
|
||||||
|
// are actually valid.
|
||||||
|
// See http://www.w3.org/TR/smil20/animation.html#AnimationNS-FromToBy
|
||||||
|
// for a definition
|
||||||
|
if( maFrom )
|
||||||
|
{
|
||||||
|
// From-to or From-by animation. According to
|
||||||
|
// SMIL spec, the To value takes precedence
|
||||||
|
// over the By value, if both are specified
|
||||||
|
if( maTo )
|
||||||
|
{
|
||||||
|
// From-To animation
|
||||||
|
maStartValue = *maFrom;
|
||||||
|
maEndValue = *maTo;
|
||||||
|
}
|
||||||
|
else if( maBy )
|
||||||
|
{
|
||||||
|
// From-By animation
|
||||||
|
maStartValue = *maFrom;
|
||||||
|
maEndValue = maStartValue + *maBy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
maStartValue = aAnimationStartValue;
|
||||||
|
maStartInterpolationValue = maStartValue;
|
||||||
|
|
||||||
|
// By or To animation. According to SMIL spec,
|
||||||
|
// the To value takes precedence over the By
|
||||||
|
// value, if both are specified
|
||||||
|
if( maTo )
|
||||||
|
{
|
||||||
|
// To animation
|
||||||
|
|
||||||
|
// According to the SMIL spec
|
||||||
|
// (http://www.w3.org/TR/smil20/animation.html#animationNS-ToAnimation),
|
||||||
|
// the to animation interpolates between
|
||||||
|
// the _running_ underlying value and the to value (as the end value)
|
||||||
|
mbDynamicStartValue = true;
|
||||||
|
maPreviousValue = maStartValue;
|
||||||
|
maEndValue = *maTo;
|
||||||
|
}
|
||||||
|
else if( maBy )
|
||||||
|
{
|
||||||
|
// By animation
|
||||||
|
maStartValue = aAnimationStartValue;
|
||||||
|
maEndValue = maStartValue + *maBy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void endAnimation()
|
virtual void endAnimation()
|
||||||
{
|
{
|
||||||
// end animation
|
// end animation
|
||||||
@@ -268,7 +340,18 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Disposable:
|
||||||
|
virtual void dispose()
|
||||||
|
{
|
||||||
|
mpAnim.reset();
|
||||||
|
BaseType::dispose();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const OptionalValueType maFrom;
|
||||||
|
const OptionalValueType maTo;
|
||||||
|
const OptionalValueType maBy;
|
||||||
|
|
||||||
ExpressionNodeSharedPtr mpFormula;
|
ExpressionNodeSharedPtr mpFormula;
|
||||||
|
|
||||||
ValueType maStartValue;
|
ValueType maStartValue;
|
||||||
@@ -338,6 +421,7 @@ AnimationActivitySharedPtr createFromToByActivity(
|
|||||||
|
|
||||||
return AnimationActivitySharedPtr(
|
return AnimationActivitySharedPtr(
|
||||||
new FromToByActivity<BaseType, AnimationType>(
|
new FromToByActivity<BaseType, AnimationType>(
|
||||||
|
aFrom,
|
||||||
aTo,
|
aTo,
|
||||||
aBy,
|
aBy,
|
||||||
rParms,
|
rParms,
|
||||||
@@ -439,6 +523,17 @@ public:
|
|||||||
ENSURE_OR_THROW( !rValues.empty(), "Empty value vector" );
|
ENSURE_OR_THROW( !rValues.empty(), "Empty value vector" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void startAnimation()
|
||||||
|
{
|
||||||
|
if (this->isDisposed() || !mpAnim)
|
||||||
|
return;
|
||||||
|
BaseType::startAnimation();
|
||||||
|
|
||||||
|
// start animation
|
||||||
|
mpAnim->start( BaseType::getShape(),
|
||||||
|
BaseType::getShapeAttributeLayer() );
|
||||||
|
}
|
||||||
|
|
||||||
virtual void endAnimation()
|
virtual void endAnimation()
|
||||||
{
|
{
|
||||||
// end animation
|
// end animation
|
||||||
|
Reference in New Issue
Block a user