Merge pull request #40643 from KoBeWi/key_keeper

Keep transition value when replacing key
This commit is contained in:
Rémi Verschelde 2020-07-24 00:03:43 +02:00 committed by GitHub
commit b642e430ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -752,7 +752,9 @@ int Animation::_insert(float p_time, T &p_keys, const V &p_value) {
while (true) {
// Condition for replacement.
if (idx > 0 && Math::is_equal_approx(p_keys[idx - 1].time, p_time)) {
float transition = p_keys[idx - 1].transition;
p_keys.write[idx - 1] = p_value;
p_keys.write[idx - 1].transition = transition;
return idx - 1;
// Condition for insert.