diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-18 09:40:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 09:40:40 +0100 |
commit | 92fe1f27ecef21c6a6ae9556555a7a82b9a573b2 (patch) | |
tree | dbb54d4623dbe897ee87b856368827d489c87e2e /editor | |
parent | 46600e1347ab38034f79d83324c8b11981f80988 (diff) | |
parent | 489eac3f130f1e0d296b73147234cf82fb2fc4d3 (diff) |
Merge pull request #15826 from MarianoGnu/master
TileSetEditorPlugin: take scale in accout when highlighting current selected subtile.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 10 |
1 files 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<Vector2> &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)); |