From 489eac3f130f1e0d296b73147234cf82fb2fc4d3 Mon Sep 17 00:00:00 2001 From: Mariano Suligoy Date: Wed, 17 Jan 2018 21:07:43 -0300 Subject: TileSetEditorPlugin: take scale in accout when highlighting current selected subtile. --- editor/plugins/tile_set_editor_plugin.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index f47f9e55bb..1dedf92452 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -1235,14 +1235,14 @@ void AutotileEditor::draw_highlight_tile(Vector2 coord, const Vector &o workspace->draw_rect(Rect2(0, coord.y, coord.x, size.y), Color(0.5, 0.5, 0.5, 0.5)); workspace->draw_rect(Rect2(coord.x + size.x, coord.y, region.size.x - coord.x - size.x, size.y), Color(0.5, 0.5, 0.5, 0.5)); workspace->draw_rect(Rect2(0, coord.y + size.y, region.size.x, region.size.y - size.y - coord.y), Color(0.5, 0.5, 0.5, 0.5)); - coord += Vector2(1, 1); - workspace->draw_rect(Rect2(coord, size - Vector2(2, 2)), Color(1, 0, 0), false); + coord += Vector2(1, 1) / workspace->get_scale().x; + workspace->draw_rect(Rect2(coord, size - Vector2(2, 2) / workspace->get_scale().x), Color(1, 0, 0), false); for (int i = 0; i < other_highlighted.size(); i++) { coord = other_highlighted[i]; coord.x *= (size.x + spacing); coord.y *= (size.y + spacing); - coord += Vector2(1, 1); - workspace->draw_rect(Rect2(coord, size - Vector2(2, 2)), Color(1, 0, 0), false); + coord += Vector2(1, 1) / workspace->get_scale().x; + workspace->draw_rect(Rect2(coord, size - Vector2(2, 2) / workspace->get_scale().x), Color(1, 0, 0), false); } } @@ -1251,8 +1251,6 @@ void AutotileEditor::draw_grid_snap() { Color grid_color = Color(0.39, 0, 1, 0.2f); Size2 s = workspace->get_size(); - Vector2 size = tile_set->autotile_get_size(get_current_tile()); - int width_count = (int)(s.width / (snap_step.x + snap_separation.x)); int height_count = (int)(s.height / (snap_step.y + snap_separation.y)); -- cgit v1.2.3