|
@@ -358,8 +358,6 @@ bool Animation::is_replaceable() const
|
|
|
|
|
|
void Animation::set_replace_state(Bindings::AnimationReplaceState value)
|
|
|
{
|
|
|
- m_replace_state = value;
|
|
|
-
|
|
|
if (value == Bindings::AnimationReplaceState::Removed) {
|
|
|
// Remove the associated effect from its target, if applicable
|
|
|
if (m_effect && m_effect->target())
|
|
@@ -367,7 +365,14 @@ void Animation::set_replace_state(Bindings::AnimationReplaceState value)
|
|
|
|
|
|
// Remove this animation from its timeline
|
|
|
m_timeline->disassociate_with_animation(*this);
|
|
|
+ } else if (value == Bindings::AnimationReplaceState::Persisted && m_replace_state == Bindings::AnimationReplaceState::Removed) {
|
|
|
+ // This animation was removed, but is now being "unremoved"; undo the effects from the if-statement above
|
|
|
+ if (m_effect && m_effect->target())
|
|
|
+ m_effect->target()->associate_with_animation(*this);
|
|
|
+ m_timeline->associate_with_animation(*this);
|
|
|
}
|
|
|
+
|
|
|
+ m_replace_state = value;
|
|
|
}
|
|
|
|
|
|
// https://www.w3.org/TR/web-animations-1/#dom-animation-onfinish
|