diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-01-17 10:26:10 +0100 |
---|---|---|
committer | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-01-17 10:30:07 +0100 |
commit | 6285d6e5f54f1b11b9fb43402f15c175e876d405 (patch) | |
tree | 4c056432c8a0a0d1ec6464a15519b2b054c14c48 /editor/plugins/tiles/tile_map_editor.cpp | |
parent | 5a39c63ebbd0e28ae7168124ffd7269f001db288 (diff) | |
download | redot-engine-6285d6e5f54f1b11b9fb43402f15c175e876d405.tar.gz |
Fixes rectangle painting when dragging outside the atlas area
Diffstat (limited to 'editor/plugins/tiles/tile_map_editor.cpp')
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 81dd8bc8a6..23b6da438c 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -1716,8 +1716,8 @@ void TileMapEditorTilesPlugin::_tile_atlas_control_draw() { // Draw the selection rect. if (tile_set_dragging_selection) { - Vector2i start_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_set_drag_start_mouse_pos); - Vector2i end_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_atlas_control->get_local_mouse_position()); + Vector2i start_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_set_drag_start_mouse_pos, true); + Vector2i end_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_atlas_control->get_local_mouse_position(), true); Rect2i region = Rect2i(start_tile, end_tile - start_tile).abs(); region.size += Vector2i(1, 1); @@ -1812,8 +1812,8 @@ void TileMapEditorTilesPlugin::_tile_atlas_control_gui_input(const Ref<InputEven tile_set_selection.clear(); } // Compute the covered area. - Vector2i start_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_set_drag_start_mouse_pos); - Vector2i end_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_atlas_control->get_local_mouse_position()); + Vector2i start_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_set_drag_start_mouse_pos, true); + Vector2i end_tile = tile_atlas_view->get_atlas_tile_coords_at_pos(tile_atlas_control->get_local_mouse_position(), true); if (start_tile != TileSetSource::INVALID_ATLAS_COORDS && end_tile != TileSetSource::INVALID_ATLAS_COORDS) { Rect2i region = Rect2i(start_tile, end_tile - start_tile).abs(); region.size += Vector2i(1, 1); |