diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-11-13 20:07:19 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-11-15 13:16:21 +0100 |
commit | d7cd44418df1e36283777d339764835040f8297c (patch) | |
tree | bfda5465b5d42e8e26e5405d1c3c4bce5860282b | |
parent | 3e214a88380dab46a77d48863b7a6f1bc37e2885 (diff) | |
download | redot-engine-d7cd44418df1e36283777d339764835040f8297c.tar.gz |
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.
-rw-r--r-- | editor/animation_track_editor.cpp | 5 | ||||
-rw-r--r-- | editor/icons/KeyEasedSelected.svg | 1 | ||||
-rw-r--r-- | editor/icons/KeyValueEased.svg | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index b45fd7f443..f8f66d08d4 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -2257,6 +2257,11 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool Ref<Texture2D> 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), real_t(1.0))) { + // Use a different icon for keys with non-linear easing. + icon_to_draw = get_theme_icon(p_selected ? SNAME("KeyEasedSelected") : SNAME("KeyValueEased"), SNAME("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/KeyEasedSelected.svg b/editor/icons/KeyEasedSelected.svg new file mode 100644 index 0000000000..c06d94c553 --- /dev/null +++ b/editor/icons/KeyEasedSelected.svg @@ -0,0 +1 @@ +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#5fb2ff" height="9.999999" rx=".948002" stroke-width="1.2427" width="9.999999" x=".000001" y=".000035"/><rect fill="#003e7a" height="5.628136" rx=".533549" stroke-width=".699406" transform="matrix(.99989481 .01450427 .01450427 .99989481 0 0)" width="5.628136" x="2.115027" y="2.114924"/></svg> diff --git a/editor/icons/KeyValueEased.svg b/editor/icons/KeyValueEased.svg new file mode 100644 index 0000000000..4e4a33c006 --- /dev/null +++ b/editor/icons/KeyValueEased.svg @@ -0,0 +1 @@ +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#e0e0e0" height="8.000001" rx="1.000032" ry="1.00003" stroke-width="1.3109" transform="rotate(-90)" width="8.000016" x="-9.000016" y=".999999"/></svg> |