diff options
author | kobewi <kobewi4e@gmail.com> | 2022-05-22 21:28:47 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-05-22 21:28:47 +0200 |
commit | 5d413eaa962bc5102a2fc8c1ba31dc9f2ccd577b (patch) | |
tree | cec6de34fd5863fb7d3cb84b61df23ea42304da1 | |
parent | 01d383a8ff11791e823bb5283dc797ea37abe198 (diff) | |
download | redot-engine-5d413eaa962bc5102a2fc8c1ba31dc9f2ccd577b.tar.gz |
Redraw selected 3D gizmo on deselect
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index cbdb1e520a..a0ca219c61 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8126,7 +8126,13 @@ void Node3DEditorPlugin::edit(Object *p_object) { } bool Node3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Node3D"); + if (p_object->is_class("Node3D")) { + return true; + } else { + // This ensures that gizmos are cleared when selecting a non-Node3D node. + const_cast<Node3DEditorPlugin *>(this)->edit((Object *)nullptr); + return false; + } } Dictionary Node3DEditorPlugin::get_state() const { |