1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Add FPS compatible option in second mode of animation editor snapping

This commit is contained in:
Silc Lizard (Tokage) Renew
2024-11-10 14:15:24 +09:00
parent e65a23762b
commit 64d04c375c
4 changed files with 66 additions and 10 deletions

View File

@@ -580,8 +580,10 @@ float AnimationPlayerEditor::_get_editor_step() const {
const Ref<Animation> anim = player->get_animation(current);
ERR_FAIL_COND_V(anim.is_null(), 0.0);
float step = track_editor->get_snap_unit();
// Use more precise snapping when holding Shift
return Input::get_singleton()->is_key_pressed(Key::SHIFT) ? anim->get_step() * 0.25 : anim->get_step();
return Input::get_singleton()->is_key_pressed(Key::SHIFT) ? step * 0.25 : step;
}
void AnimationPlayerEditor::_animation_name_edited() {