diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2022-09-18 22:26:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 22:26:15 +0300 |
commit | 908795301b9e4fcf24b115329a48d7d295c13a1a (patch) | |
tree | 772b67421bde00faad326f228a6968594cc976d6 | |
parent | e5594c26b14e75d8b75d1f697cf2bfbd6254a50c (diff) | |
parent | b9d9528c459c924350bfeddcc15a8847bfe8c366 (diff) |
Merge pull request #66040 from jeffres/fix-closing-shader-file-with-middle-mouse-click
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 815a61f8ac..ae3c578eaa 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -1376,11 +1376,10 @@ void ShaderEditorPlugin::_shader_list_clicked(int p_item, Vector2 p_local_mouse_ } void ShaderEditorPlugin::_close_shader(int p_index) { - int index = shader_tabs->get_current_tab(); - ERR_FAIL_INDEX(index, shader_tabs->get_tab_count()); - Control *c = shader_tabs->get_tab_control(index); + ERR_FAIL_INDEX(p_index, shader_tabs->get_tab_count()); + Control *c = shader_tabs->get_tab_control(p_index); memdelete(c); - edited_shaders.remove_at(index); + edited_shaders.remove_at(p_index); _update_shader_list(); EditorNode::get_singleton()->get_undo_redo()->clear_history(); // To prevent undo on deleted graphs. } |