Browse Source

Fix OccluderPolyShape handles disappear after release click

(cherry picked from commits dd3bda91567cdde3335d9bdbab7b9942eb46a89c
and 98803d4edde8f194fcabcc7caacd84e7763f3b45)
Haoyu Qiu 2 years ago
parent
commit
57ad3e9670
1 changed files with 3 additions and 2 deletions
  1. 3 2
      editor/plugins/spatial_editor_plugin.cpp

+ 3 - 2
editor/plugins/spatial_editor_plugin.cpp

@@ -7013,11 +7013,12 @@ void SpatialEditorPlugin::edit(Object *p_object) {
 bool SpatialEditorPlugin::handles(Object *p_object) const {
 bool SpatialEditorPlugin::handles(Object *p_object) const {
 	if (p_object->is_class("Spatial")) {
 	if (p_object->is_class("Spatial")) {
 		return true;
 		return true;
-	} else {
+	}
+	if (!p_object->is_class("Resource")) {
 		// This ensures that gizmos are cleared when selecting a non-Spatial node.
 		// This ensures that gizmos are cleared when selecting a non-Spatial node.
 		const_cast<SpatialEditorPlugin *>(this)->edit((Object *)nullptr);
 		const_cast<SpatialEditorPlugin *>(this)->edit((Object *)nullptr);
-		return false;
 	}
 	}
+	return false;
 }
 }
 
 
 Dictionary SpatialEditorPlugin::get_state() const {
 Dictionary SpatialEditorPlugin::get_state() const {