浏览代码

Fix Animation bezier key selection bugs

emild 1 年之前
父节点
当前提交
080315ca6b
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      editor/animation_bezier_editor.cpp

+ 14 - 3
editor/animation_bezier_editor.cpp

@@ -840,19 +840,30 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 			}
 			accept_event();
 		}
+		if (ED_IS_SHORTCUT("animation_editor/cut_selected_keys", p_event)) {
+			if (!read_only) {
+				copy_selected_keys(true);
+			}
+			accept_event();
+		}
 		if (ED_IS_SHORTCUT("animation_editor/copy_selected_keys", p_event)) {
 			if (!read_only) {
 				copy_selected_keys(false);
 			}
 			accept_event();
 		}
-
 		if (ED_IS_SHORTCUT("animation_editor/paste_keys", p_event)) {
 			if (!read_only) {
 				paste_keys(-1.0);
 			}
 			accept_event();
 		}
+		if (ED_IS_SHORTCUT("animation_editor/delete_selection", p_event)) {
+			if (!read_only) {
+				delete_selection();
+			}
+			accept_event();
+		}
 	}
 
 	Ref<InputEventKey> key_press = p_event;
@@ -1247,7 +1258,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 
 	if (moving_selection_attempt && mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT) {
 		if (!read_only) {
-			if (moving_selection) {
+			if (moving_selection && (abs(moving_selection_offset.x) > 0 || abs(moving_selection_offset.y) > 0)) {
 				//combit it
 
 				EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
@@ -1504,7 +1515,7 @@ bool AnimationBezierTrackEdit::_try_select_at_ui_pos(const Point2 &p_pos, bool p
 				}
 
 				set_animation_and_track(animation, pair.first, read_only);
-				if (p_deselectable || !selection.has(pair)) {
+				if (!selection.has(pair)) {
 					selection.clear();
 					selection.insert(pair);
 				}