Merge pull request #3641 from JoshuaGrams/master
AnimationPlayer frame SpinBox snaps to steps.
This commit is contained in:
commit
080dfa14a0
1 changed files with 8 additions and 0 deletions
|
@ -942,6 +942,14 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value) {
|
||||||
anim=player->get_animation(current);
|
anim=player->get_animation(current);
|
||||||
|
|
||||||
float pos = anim->get_length() * (p_value / frame->get_max());
|
float pos = anim->get_length() * (p_value / frame->get_max());
|
||||||
|
float step = anim->get_step();
|
||||||
|
if (step) {
|
||||||
|
pos=Math::stepify(pos, step);
|
||||||
|
if (pos<0)
|
||||||
|
pos=0;
|
||||||
|
if (pos>=anim->get_length())
|
||||||
|
pos=anim->get_length();
|
||||||
|
}
|
||||||
|
|
||||||
if (player->is_valid()) {
|
if (player->is_valid()) {
|
||||||
float cpos = player->get_current_animation_pos();
|
float cpos = player->get_current_animation_pos();
|
||||||
|
|
Loading…
Reference in a new issue