diff options
author | Till Mayer <till.mayer@web.de> | 2020-03-12 23:08:56 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-13 10:40:45 +0100 |
commit | de6f697ebabfbe998ef2fcb16817131f8a796a0e (patch) | |
tree | f345b62d49f9128b3847d8c8ddd9aa62c052ac99 /Games | |
parent | 3e25c58755792eaf9b8ffa06820ae659751dfe85 (diff) | |
download | serenity-de6f697ebabfbe998ef2fcb16817131f8a796a0e.zip |
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
Diffstat (limited to 'Games')
-rw-r--r-- | Games/Solitaire/SolitaireWidget.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Games/Solitaire/SolitaireWidget.cpp b/Games/Solitaire/SolitaireWidget.cpp index b3747a02dd..3ec581d617 100644 --- a/Games/Solitaire/SolitaireWidget.cpp +++ b/Games/Solitaire/SolitaireWidget.cpp @@ -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); |