mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
Hearts: Fix animations that get stuck "mid-flight"
When an animation is stopped the cards should be moved to their final position anyway. Otherwise they might end up getting stuck in the middle of the animation.
This commit is contained in:
parent
87ace131bc
commit
fc99aa92bd
1 changed files with 5 additions and 1 deletions
|
@ -251,7 +251,11 @@ void Game::start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const&
|
|||
|
||||
void Game::stop_animation()
|
||||
{
|
||||
m_animation_playing = false;
|
||||
if (m_animation_playing) {
|
||||
for (auto& animation : m_animation_cards)
|
||||
animation.card->set_position(m_animation_end);
|
||||
m_animation_playing = false;
|
||||
}
|
||||
if (m_animation_delay_timer)
|
||||
m_animation_delay_timer->stop();
|
||||
stop_timer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue