From 4a4d977bea7692395da0f66363709e89cae6e126 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 9 May 2021 09:54:15 +0200 Subject: Improve the animation bezier editor - Allow snapping bezier handles to the timeline. - Allow precise snapping when holding Shift for keyframes and handles. - Previously, it was only allowed for seeking the timeline. - This change also impacts the animation track editor, not just the bezier editor. - Invert the Ctrl + mouse wheel behavior to match the zoom direction in the animation track editor. - Increase the line spacing between the "Time:" and "Value:" texts to improve readability. - Tweak box selection styling to match the animation track editor. - Adjust line widths for hiDPI displays. --- editor/animation_track_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'editor/animation_track_editor.cpp') diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 964c37906f..ff2818f027 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5642,6 +5642,11 @@ float AnimationTrackEditor::snap_time(float p_value, bool p_relative) { snap_increment = step->get_value(); } + if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + // Use more precise snapping when holding Shift. + snap_increment *= 0.25; + } + if (p_relative) { double rel = Math::fmod(timeline->get_value(), snap_increment); p_value = Math::snapped(p_value + rel, snap_increment) - rel; -- cgit v1.2.3