summaryrefslogtreecommitdiff
path: root/editor/plugins/tiles/tiles_editor_plugin.cpp
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-08-20 18:39:05 +0200
committerMicky <micheledevita2@gmail.com>2022-09-05 18:08:39 +0200
commit694190a354c1634caaff5cbd7357de345a334c01 (patch)
tree3caa05876de5bd4ac51860434ba4665ddd34d75e /editor/plugins/tiles/tiles_editor_plugin.cpp
parent90801a415314f29eb5c590f85a7751443e54b83a (diff)
Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
For both TileMap and GridMap: - `world_to_map` -> `local_to_map` - `map_to_world` -> `map_to_local` Also changes any mention of "world" in this context to "local" to avoid future confusion. Finally, updates the docs of both methods for consistency. In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
Diffstat (limited to 'editor/plugins/tiles/tiles_editor_plugin.cpp')
-rw-r--r--editor/plugins/tiles/tiles_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp
index b5134f6893..87b5be1142 100644
--- a/editor/plugins/tiles/tiles_editor_plugin.cpp
+++ b/editor/plugins/tiles/tiles_editor_plugin.cpp
@@ -91,10 +91,10 @@ void TilesEditorPlugin::_thread() {
TypedArray<Vector2i> used_cells = tile_map->get_used_cells(0);
Rect2 encompassing_rect = Rect2();
- encompassing_rect.set_position(tile_map->map_to_world(used_cells[0]));
+ encompassing_rect.set_position(tile_map->map_to_local(used_cells[0]));
for (int i = 0; i < used_cells.size(); i++) {
Vector2i cell = used_cells[i];
- Vector2 world_pos = tile_map->map_to_world(cell);
+ Vector2 world_pos = tile_map->map_to_local(cell);
encompassing_rect.expand_to(world_pos);
// Texture.