瀏覽代碼

Update to only use select tool on button press

It used to run the code twice, probably once on button press, once on button release.
taigi100 3 年之前
父節點
當前提交
6c4dbf92ac
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/plugins/canvas_item_editor_plugin.cpp

+ 1 - 1
editor/plugins/canvas_item_editor_plugin.cpp

@@ -2216,7 +2216,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
 	Ref<InputEventKey> k = p_event;
 
 	if (drag_type == DRAG_NONE) {
-		if (b.is_valid() &&
+		if (b.is_valid() && b->is_pressed() &&
 				((b->get_button_index() == MouseButton::RIGHT && b->is_alt_pressed() && tool == TOOL_SELECT) ||
 						(b->get_button_index() == MouseButton::LEFT && tool == TOOL_LIST_SELECT))) {
 			// Popup the selection menu list