diff options
author | Silc Renew <tokage.it.lab@gmail.com> | 2022-09-06 12:24:06 +0900 |
---|---|---|
committer | Silc Renew <tokage.it.lab@gmail.com> | 2022-09-15 04:52:43 +0900 |
commit | 9d47e079b72c2a0f41e61aebf9f915766fac3bcf (patch) | |
tree | 88f3001bd534561a3aa3b5023a0ccd867644cdea /editor | |
parent | b6d102c7c2d5e9f39f368bf1ebc91a48bf762c42 (diff) |
Move some methods to Animation from Variant for refactoring
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 4991b2cfaf..38476c0a13 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -6056,10 +6056,9 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { real_t to_diff = fmod(b - a, Math_TAU); to_v = a + fmod(2.0 * to_diff, Math_TAU) - to_diff; } - Variant delta_v; - Variant::sub(to_v, from_v, delta_v); + Variant delta_v = Animation::subtract_variant(to_v, from_v); double duration = to_t - from_t; - double fixed_duration = duration - 0.01; // Prevent to overwrap keys... + double fixed_duration = duration - UNIT_EPSILON; // Prevent to overwrap keys... for (double delta_t = dur_step; delta_t < fixed_duration; delta_t += dur_step) { Pair<real_t, Variant> keydata; keydata.first = from_t + delta_t; |