mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:27:43 +00:00
LibWeb: Disassociate animations from Animatables when setting effects
This commit is contained in:
parent
90290eb985
commit
e11b9658ed
1 changed files with 8 additions and 0 deletions
|
@ -74,6 +74,14 @@ void Animation::set_effect(JS::GCPtr<AnimationEffect> new_effect)
|
|||
}
|
||||
|
||||
// 6. Let the associated effect of animation be new effect.
|
||||
auto old_target = m_effect ? m_effect->target() : nullptr;
|
||||
auto new_target = new_effect ? new_effect->target() : nullptr;
|
||||
if (old_target != new_target) {
|
||||
if (old_target)
|
||||
old_target->disassociate_with_animation(*this);
|
||||
if (new_target)
|
||||
new_target->associate_with_animation(*this);
|
||||
}
|
||||
if (new_effect)
|
||||
new_effect->set_associated_animation(this);
|
||||
if (m_effect)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue