Solitaire: Fix automatic moving of cards
A previous change trying to fix an assertion error completely broke the automatic moving of cards, this commit will fix this problem
This commit is contained in:
parent
3e25c58755
commit
de6f697eba
Notes:
sideshowbarker
2024-07-19 08:20:04 +09:00
Author: https://github.com/tlmrgvf Commit: https://github.com/SerenityOS/serenity/commit/de6f697ebab Pull-request: https://github.com/SerenityOS/serenity/pull/1434
1 changed files with 2 additions and 4 deletions
|
@ -312,12 +312,9 @@ void SolitaireWidget::doubleclick_event(GUI::MouseEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!m_focused_cards.is_empty())
|
||||
return;
|
||||
|
||||
auto click_location = event.position();
|
||||
for (auto& to_check : m_stacks) {
|
||||
if (to_check.type() == CardStack::Type::Foundation)
|
||||
if (to_check.type() == CardStack::Type::Foundation || to_check.type() == CardStack::Type::Stock)
|
||||
continue;
|
||||
|
||||
if (to_check.bounding_box().contains(click_location) && !to_check.is_empty()) {
|
||||
|
@ -360,6 +357,7 @@ void SolitaireWidget::move_card(CardStack& from, CardStack& to)
|
|||
auto card = from.pop();
|
||||
|
||||
card->set_moving(true);
|
||||
m_focused_cards.clear();
|
||||
m_focused_cards.append(card);
|
||||
mark_intersecting_stacks_dirty(card);
|
||||
to.push(card);
|
||||
|
|
Loading…
Add table
Reference in a new issue