From e36a8e266a241e0723b4e16f5b5c2173e0a0d64c Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Mon, 4 May 2026 20:47:42 -0300 Subject: [PATCH] Fix incorrect grid floor position before input in the `GridMap` editor --- modules/gridmap/editor/grid_map_editor_plugin.cpp | 12 +----------- modules/gridmap/editor/grid_map_editor_plugin.h | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index efca025e45..c38ab156be 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -60,14 +60,6 @@ #include "scene/main/window.h" #include "servers/rendering/rendering_server.h" -void GridMapEditor::_configure() { - if (!node) { - return; - } - - update_grid(); -} - void GridMapEditor::_menu_option(int p_option) { switch (p_option) { case MENU_OPTION_PREV_LEVEL: { @@ -1253,8 +1245,7 @@ void GridMapEditor::update_grid() { grid_ofs[edit_axis] = edit_floor[edit_axis] * node->get_cell_size()[edit_axis]; - // If there's a valid tile cursor, offset the grid, otherwise move it back to the node. - edit_grid_xform.origin = cursor_instance.is_valid() ? grid_ofs : Vector3(); + edit_grid_xform.origin = grid_ofs; edit_grid_xform.basis = Basis(); for (int i = 0; i < 3; i++) { @@ -1487,7 +1478,6 @@ void GridMapEditor::_floor_mouse_exited() { } void GridMapEditor::_bind_methods() { - ClassDB::bind_method("_configure", &GridMapEditor::_configure); ClassDB::bind_method("_set_selection", &GridMapEditor::_set_selection); ADD_SIGNAL(MethodInfo("overlay_update_requested")); diff --git a/modules/gridmap/editor/grid_map_editor_plugin.h b/modules/gridmap/editor/grid_map_editor_plugin.h index 5e9e87643b..d04aeca070 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.h +++ b/modules/gridmap/editor/grid_map_editor_plugin.h @@ -221,7 +221,6 @@ class GridMapEditor : public EditorDock { void update_grid(); // Change which and where the grid is displayed. void _draw_grids(const Vector3 &cell_size); - void _configure(); void _menu_option(int); void update_palette(); void _update_resource_preview(const String &p_path, const Ref &p_preview, const Ref &p_small_preview, int p_idx);