From 5dc677822d02cb25e902f2af247a6911e4acbbd9 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 31 Mar 2022 18:39:04 +0800 Subject: [PATCH] Clip animation track keyframe rects (cherry picked from commit c7e06e2202c97dbd75933fe1b587d668a717c5f2) --- editor/animation_track_editor_plugins.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 367b7dfb8..3cb5e4b18 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -341,11 +341,11 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); Color color = get_color("font_color", "Label"); - draw_rect(rect, color); + draw_rect_clipped(rect, color); if (p_selected) { Color accent = get_color("accent_color", "Editor"); - draw_rect(rect, accent, false); + draw_rect_clipped(rect, accent, false); } } } @@ -704,11 +704,11 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_ Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); Color color = get_color("font_color", "Label"); - draw_rect(rect, color); + draw_rect_clipped(rect, color); if (p_selected) { Color accent = get_color("accent_color", "Editor"); - draw_rect(rect, accent, false); + draw_rect_clipped(rect, accent, false); } } } @@ -1268,11 +1268,11 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); Color color = get_color("font_color", "Label"); - draw_rect(rect, color); + draw_rect_clipped(rect, color); if (p_selected) { Color accent = get_color("accent_color", "Editor"); - draw_rect(rect, accent, false); + draw_rect_clipped(rect, accent, false); } } }