fix: color draw pile when it is hovered/selected

ci-dev
LeRoyce Pearson 2024-04-21 11:46:52 -06:00
parent 30eefb5279
commit d6a1438f98
1 changed files with 7 additions and 1 deletions

View File

@ -335,8 +335,14 @@ fn render(window: *seizer.Window) !void {
}
{
const is_selected = selected_deck != null and selected_deck.? == &draw_pile;
const is_hovered = hovered_deck != null and hovered_deck.? == &draw_pile;
const color = if (is_hovered) [4]u8{ 0xA0, 0xFF, 0xA0, 0xFF } else [4]u8{ 0xFF, 0xFF, 0xFF, 0xFF };
const color = if (is_selected)
[4]u8{ 0xFF, 0xA0, 0xA0, 0xFF }
else if (is_hovered)
[4]u8{ 0xA0, 0xFF, 0xA0, 0xFF }
else
[4]u8{ 0xFF, 0xFF, 0xFF, 0xFF };
var pos = [2]f32{ @floatFromInt(margin), @floatFromInt(margin) };
pos[0] += board_offset[0];