From 4b84803456fd25b1e4012e1d334fa9b990560537 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Wed, 29 Nov 2023 02:47:33 +0200 Subject: [PATCH] Loop through frames when clicking on go to previous/next frame buttons on the timeline --- src/UI/Timeline/AnimationTimeline.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index 0553b8c95..010b67015 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -644,16 +644,20 @@ func play_animation(play: bool, forward_dir: bool) -> void: func _on_NextFrame_pressed() -> void: var project := Global.current_project + project.selected_cels.clear() if project.current_frame < project.frames.size() - 1: - project.selected_cels.clear() project.change_cel(project.current_frame + 1, -1) + else: + project.change_cel(0, -1) func _on_PreviousFrame_pressed() -> void: var project := Global.current_project + project.selected_cels.clear() if project.current_frame > 0: - project.selected_cels.clear() project.change_cel(project.current_frame - 1, -1) + else: + project.change_cel(project.frames.size() - 1, -1) func _on_LastFrame_pressed() -> void: