From 9381b236ab5013440f1fc8c386702e18106fca9f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 13 Nov 2021 20:07:19 +0100 Subject: [PATCH] Use a different icon for eased keyframes in the animation editor This makes easing tracks easier to recognize, in a way similar to curved lines in the Path2D editor. --- editor/animation_track_editor.cpp | 5 +++++ editor/icons/icon_key_eased_selected.svg | 1 + editor/icons/icon_key_value_eased.svg | 1 + 3 files changed, 7 insertions(+) create mode 100644 editor/icons/icon_key_eased_selected.svg create mode 100644 editor/icons/icon_key_value_eased.svg diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 791040584e5..477ff5dcad6 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -2191,6 +2191,11 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool Ref icon_to_draw = p_selected ? selected_icon : type_icon; + if (animation->track_get_type(track) == Animation::TYPE_VALUE && !Math::is_equal_approx(animation->track_get_key_transition(track, p_index), 1.0f)) { + // Use a different icon for keys with non-linear easing. + icon_to_draw = get_icon(p_selected ? "KeyEasedSelected" : "KeyValueEased", "EditorIcons"); + } + // Override type icon for invalid value keys, unless selected. if (!p_selected && animation->track_get_type(track) == Animation::TYPE_VALUE) { const Variant &v = animation->track_get_key_value(track, p_index); diff --git a/editor/icons/icon_key_eased_selected.svg b/editor/icons/icon_key_eased_selected.svg new file mode 100644 index 00000000000..c06d94c5537 --- /dev/null +++ b/editor/icons/icon_key_eased_selected.svg @@ -0,0 +1 @@ + diff --git a/editor/icons/icon_key_value_eased.svg b/editor/icons/icon_key_value_eased.svg new file mode 100644 index 00000000000..4e4a33c0060 --- /dev/null +++ b/editor/icons/icon_key_value_eased.svg @@ -0,0 +1 @@ +