From d0ad6d6023053b85f6454bf00c9dc4ce84ecbb94 Mon Sep 17 00:00:00 2001 From: xuhuisheng Date: Wed, 8 Oct 2025 15:07:32 +0800 Subject: [PATCH] set step before set value, to fix animation length issue --- 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 340c1f819b8..a00ec87016a 100644 --- a/editor/animation/animation_track_editor.cpp +++ b/editor/animation/animation_track_editor.cpp @@ -1836,8 +1836,8 @@ void AnimationTimelineEdit::update_values() { editing = true; if (use_fps && animation->get_step() > 0.0) { - length->set_value(animation->get_length() / animation->get_step()); length->set_step(FPS_DECIMAL); + length->set_value(animation->get_length() / animation->get_step()); length->set_tooltip_text(TTR("Animation length (frames)")); time_icon->set_tooltip_text(TTR("Animation length (frames)")); if (track_edit) { @@ -1845,8 +1845,8 @@ void AnimationTimelineEdit::update_values() { track_edit->editor->marker_edit->_update_key_edit(); } } else { - length->set_value(animation->get_length()); length->set_step(SECOND_DECIMAL); + length->set_value(animation->get_length()); length->set_tooltip_text(TTR("Animation length (seconds)")); time_icon->set_tooltip_text(TTR("Animation length (seconds)")); }