Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions editor/animation/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3926,6 +3926,25 @@ void AnimationTrackEditGroup::_notification(int p_what) {
const Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(2 * EDSCALE));
}

if (is_group_folded) {
for (const AnimationTrackEdit *track_edit : track_edits) {
const Ref<Texture2D> &key_type_icon = track_edit->get_key_type_icon();
int track = track_edit->get_track();
for (int i = 0; i < editor->get_current_animation()->track_get_key_count(track); ++i) {
float key_time_offset = editor->get_current_animation()->track_get_key_time(track, i) - timeline->get_value();
int key_screen_pos = int(key_time_offset * timeline->get_zoom_scale() + limit);
int key_limit_left = timeline->get_name_limit();
int key_limit_right = get_size().width - timeline->get_buttons_width();
if (key_screen_pos >= key_limit_left && key_screen_pos <= key_limit_right) {
draw_texture(
key_type_icon,
Vector2(key_screen_pos - key_type_icon->get_width() / 2, (get_size().height - key_type_icon->get_height()) / 2),
Color(1, 1, 1, 0.3));
}
}
}
}
} break;

case NOTIFICATION_MOUSE_EXIT: {
Expand Down
1 change: 1 addition & 0 deletions editor/animation/animation_track_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class AnimationTrackEdit : public Control {
virtual CursorShape get_cursor_shape(const Point2 &p_pos) const override;
virtual String get_tooltip(const Point2 &p_pos) const override;

const Ref<Texture2D> &get_key_type_icon() const { return type_icon; }
virtual int get_key_height() const;
virtual Rect2 get_key_rect(int p_index, float p_pixels_sec);
virtual bool is_key_selectable_by_distance() const;
Expand Down
Loading