1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

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.

(cherry picked from commit 4a4d977bea)
This commit is contained in:
Hugo Locurcio
2021-05-09 09:54:15 +02:00
committed by Rémi Verschelde
parent 0a1cf70037
commit da757c25e1
2 changed files with 25 additions and 15 deletions

View File

@@ -5647,6 +5647,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::stepify(p_value + rel, snap_increment) - rel;