소스 검색

Close shader under cursor when middle mouse clicking in editor list

Previously middle mouse clicking resulted in the currently selected
file to be closed, which is not the behavior commonly expected.
jeffres 3 년 전
부모
커밋
b9d9528c45
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      editor/plugins/shader_editor_plugin.cpp

+ 3 - 4
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.
 }