Skip to content

Commit

Permalink
Fix errors introduced in code review
Browse files Browse the repository at this point in the history
Didn't realize all the changes before committing review code
  • Loading branch information
AtlaStar committed Sep 29, 2024
1 parent 59dbd1c commit d6d6184
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
#include "scene/main/window.h"
#include "servers/audio/audio_stream.h"

constexpr double FPS_DECIMAL = 1.0;
constexpr double SECOND_DECIMAL = 0.0001;
constexpr double FACTOR = 0.0625;

void AnimationTrackKeyEdit::_bind_methods() {
Expand Down Expand Up @@ -4986,7 +4988,7 @@ void AnimationTrackEditor::_update_step(double p_new_step) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Change Animation Step"));
// To ensure that the conversion results are consistent between serialization and load, the value is snapped with 0.0625 to be a rational number.
float step_value = Math::min(9999.0f, Math::snapped(p_new_step, FACTOR));
float step_value = fmin(9999.0f, Math::snapped(p_new_step, FACTOR));
if (timeline->is_using_fps()) {
if (step_value != 0.0) {
step_value = 1.0 / step_value;
Expand Down

0 comments on commit d6d6184

Please sign in to comment.