Eraser tweaks

This commit is contained in:
Nikita Lisitsa 2024-08-19 19:18:58 +03:00
parent 2ffbbfa5af
commit e28a07b4e3

View file

@ -1512,10 +1512,14 @@ namespace gmtk
{
if (selected_)
{
if (map_.world.index<index>().find(*selected_))
if (auto entity = map_.world.index<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<source>() && !acc.contains<lab>()))
{
gfx::color_rgba color = {255, 128, 128, 255};
draw_selection(selected_->bbox(), painter_, color, true);
}
}
else if (*active_card_ != card_type::eraser)
{