Merge pull request #80702 from KoBeWi/lagging_animation
Fix initial value with delay in PropertyTweener
This commit is contained in:
commit
c5a7462a00
1 changed files with 6 additions and 1 deletions
|
@ -546,8 +546,9 @@ void PropertyTweener::start() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_continue) {
|
if (do_continue && Math::is_zero_approx(delay)) {
|
||||||
initial_val = target_instance->get_indexed(property);
|
initial_val = target_instance->get_indexed(property);
|
||||||
|
do_continue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (relative) {
|
if (relative) {
|
||||||
|
@ -572,6 +573,10 @@ bool PropertyTweener::step(double &r_delta) {
|
||||||
if (elapsed_time < delay) {
|
if (elapsed_time < delay) {
|
||||||
r_delta = 0;
|
r_delta = 0;
|
||||||
return true;
|
return true;
|
||||||
|
} else if (do_continue && !Math::is_zero_approx(delay)) {
|
||||||
|
initial_val = target_instance->get_indexed(property);
|
||||||
|
delta_val = Animation::subtract_variant(final_val, initial_val);
|
||||||
|
do_continue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
double time = MIN(elapsed_time - delay, duration);
|
double time = MIN(elapsed_time - delay, duration);
|
||||||
|
|
Loading…
Reference in a new issue