diff options
author | Rasmus Ketelsen <rke@gamblify.com> | 2018-05-23 13:55:15 +0200 |
---|---|---|
committer | Rasmus Ketelsen <rke@gamblify.com> | 2018-05-25 15:05:45 +0200 |
commit | c518b96362f5a92a31b9b993f6f31cff3d397d2d (patch) | |
tree | 222b798a2010defc74eb76a33b36537a8b3a5c88 /scene/animation | |
parent | 0980991e6433a3f394a9ae99bec10cb04c8b77e0 (diff) |
Take tween speed into account when calculating runtime
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/tween.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 49013b160a..4eefcc9ced 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -886,6 +886,10 @@ real_t Tween::tell() const { real_t Tween::get_runtime() const { + if (speed_scale == 0) { + return INFINITY; + } + pending_update++; real_t runtime = 0; for (const List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) { @@ -896,7 +900,8 @@ real_t Tween::get_runtime() const { runtime = t; } pending_update--; - return runtime; + + return runtime / speed_scale; } bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final_val, Variant &p_delta_val) { |