From 205d36ace2cc99dcecdb4e33797a1eae19fa19d2 Mon Sep 17 00:00:00 2001 From: Infiland Date: Tue, 7 Apr 2026 12:12:02 +0200 Subject: [PATCH] Fix non-positive frame numbers misaligned in FPS mode --- editor/animation/animation_track_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/animation/animation_track_editor.cpp b/editor/animation/animation_track_editor.cpp index db2d8f097a..9ab07fe7e9 100644 --- a/editor/animation/animation_track_editor.cpp +++ b/editor/animation/animation_track_editor.cpp @@ -1653,8 +1653,8 @@ void AnimationTimelineEdit::_notification(int p_what) { float pos = get_value() + double(i) / scale; float prev = get_value() + (double(i) - 1.0) / scale; - int frame = pos / step_size; - int prev_frame = prev / step_size; + int frame = int(Math::floor(pos / step_size)); + int prev_frame = int(Math::floor(prev / step_size)); bool sub = Math::floor(prev) == Math::floor(pos);