fix: select top of drawn cards after double clicking

Before it would select the cards as if they were a regular stack on the
board.
ci-dev
LeRoyce Pearson 2024-04-21 11:56:36 -06:00
parent 57a09e8830
commit a99c27cb87
1 changed files with 6 additions and 1 deletions

View File

@ -472,7 +472,12 @@ pub fn doSelectOrPlace(pressed: bool) !void {
if ((empty and ace) or (suit_matches and is_next_rank)) { if ((empty and ace) or (suit_matches and is_next_rank)) {
foundation.ensureUnusedCapacity(gpa, 1) catch continue; foundation.ensureUnusedCapacity(gpa, 1) catch continue;
foundation.appendAssumeCapacity(selected_deck.?.pop()); foundation.appendAssumeCapacity(selected_deck.?.pop());
hovered_card = indexOfTopOfStack(hovered_deck.?.items);
hovered_card = if (hovered_deck.? == &drawn_cards)
hovered_deck.?.items.len -| 1
else
indexOfTopOfStack(hovered_deck.?.items);
cards_moved = true; cards_moved = true;
break; break;
} }