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);