1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:58:12 +00:00

Spider: Redraw completely when drawing cards

Spider was only updating the new bounding box area after drawing cards
from the deck - leaving behind a sliver of the old deck.

This was a regression, as the game previously used the old bounding
box, introduced by GH-11153.
This commit is contained in:
Jamie Mansfield 2022-01-02 16:20:01 +00:00 committed by Andreas Kling
parent 2251733744
commit 1d7d7d39b7
2 changed files with 3 additions and 1 deletions

View file

@ -110,6 +110,7 @@ void Game::draw_cards()
update_score(-1);
m_draw_animation = true;
m_original_stock_rect = stock_pile.bounding_box();
start_timer(s_timer_interval_ms);
}
@ -394,7 +395,7 @@ void Game::timer_event(Core::TimerEvent&)
++m_draw_animation_pile;
if (m_draw_animation_pile == piles.size()) {
update(stock_pile.bounding_box());
update(m_original_stock_rect);
detect_full_stacks();
m_draw_animation = false;

View file

@ -102,6 +102,7 @@ private:
bool m_draw_animation { false };
uint8_t m_draw_animation_delay { 0 };
uint8_t m_draw_animation_pile { 0 };
Gfx::IntRect m_original_stock_rect;
uint32_t m_score { 500 };
};