Make selected tile in TileSet more visible through red outline

(cherry picked from commit 433bf37287)
This commit is contained in:
Sofox 2025-04-15 22:06:04 +01:00 committed by lawnjelly
parent 4d7586d759
commit bb4893f687

View file

@ -2457,6 +2457,7 @@ void TileSetEditor::_zoom_on_position(float p_zoom, const Vector2 &p_position) {
void TileSetEditor::draw_highlight_current_tile() { void TileSetEditor::draw_highlight_current_tile() {
Color shadow_color = Color(0.3, 0.3, 0.3, 0.3); Color shadow_color = Color(0.3, 0.3, 0.3, 0.3);
Color border_color_red = Color(1, 0.1, 0.1, 0.9);
if ((workspace_mode == WORKSPACE_EDIT && get_current_tile() >= 0) || !edited_region.has_no_area()) { if ((workspace_mode == WORKSPACE_EDIT && get_current_tile() >= 0) || !edited_region.has_no_area()) {
Rect2 region; Rect2 region;
if (edited_region.has_no_area()) { if (edited_region.has_no_area()) {
@ -2478,6 +2479,7 @@ void TileSetEditor::draw_highlight_current_tile() {
if (region.position.y + region.size.y <= workspace->get_rect().size.y) { if (region.position.y + region.size.y <= workspace->get_rect().size.y) {
workspace->draw_rect(Rect2(0, region.position.y + region.size.y, workspace->get_rect().size.x, workspace->get_rect().size.y - region.size.y - region.position.y), shadow_color); workspace->draw_rect(Rect2(0, region.position.y + region.size.y, workspace->get_rect().size.x, workspace->get_rect().size.y - region.size.y - region.position.y), shadow_color);
} }
workspace->draw_rect(region.grow_individual(1.0f, 0.0f, 0.0f, 1.0f), border_color_red, false, 2.0f);
} else { } else {
workspace->draw_rect(Rect2(Point2(0, 0), workspace->get_rect().size), shadow_color); workspace->draw_rect(Rect2(Point2(0, 0), workspace->get_rect().size), shadow_color);
} }