From e28a07b4e3da356b421bb56bd2e63f2ec072b624 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 19 Aug 2024 19:18:58 +0300 Subject: [PATCH] Eraser tweaks --- source/application.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/application.cpp b/source/application.cpp index 7faec43..3bba878 100644 --- a/source/application.cpp +++ b/source/application.cpp @@ -1512,10 +1512,14 @@ namespace gmtk { if (selected_) { - if (map_.world.index().find(*selected_)) + if (auto entity = map_.world.index().find(*selected_)) { - gfx::color_rgba color = {255, 128, 128, 255}; - draw_selection(selected_->bbox(), painter_, color, true); + auto acc = map_.world.get(*entity); + if (*active_card_ != card_type::eraser || (!acc.contains() && !acc.contains())) + { + gfx::color_rgba color = {255, 128, 128, 255}; + draw_selection(selected_->bbox(), painter_, color, true); + } } else if (*active_card_ != card_type::eraser) {