diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-02-16 07:41:59 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-02-16 07:41:59 +0100 |
commit | 080dfa14a055fa4bc6d539f048f1ead5c7c4e56a (patch) | |
tree | 7ecc1fa0635c6036a02dc4c416b2a9b065ddda60 /tools | |
parent | 866208c9da7853a4ef443edbe2806c8be2da2b78 (diff) | |
parent | 5317ca4c622888c785da982b257ef5397ba7bb12 (diff) |
Merge pull request #3641 from JoshuaGrams/master
AnimationPlayer frame SpinBox snaps to steps.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 32afd86970..fcb9f4db14 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -942,6 +942,14 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value) { anim=player->get_animation(current); 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()) { float cpos = player->get_current_animation_pos(); |