mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 06:03:38 +00:00
Merge pull request #19120 from Keetz/master
Take tween speed into account when calculating runtime
This commit is contained in:
commit
47cfdfe2ee
@ -886,6 +886,10 @@ real_t Tween::tell() const {
|
|||||||
|
|
||||||
real_t Tween::get_runtime() const {
|
real_t Tween::get_runtime() const {
|
||||||
|
|
||||||
|
if (speed_scale == 0) {
|
||||||
|
return INFINITY;
|
||||||
|
}
|
||||||
|
|
||||||
pending_update++;
|
pending_update++;
|
||||||
real_t runtime = 0;
|
real_t runtime = 0;
|
||||||
for (const List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) {
|
for (const List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) {
|
||||||
@ -896,7 +900,8 @@ real_t Tween::get_runtime() const {
|
|||||||
runtime = t;
|
runtime = t;
|
||||||
}
|
}
|
||||||
pending_update--;
|
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) {
|
bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final_val, Variant &p_delta_val) {
|
||||||
|
Loading…
Reference in New Issue
Block a user