Keep transition value when replacing key

This commit is contained in:
Tomasz Chabora 2020-07-23 22:59:04 +02:00
parent 3c6f5226f7
commit e1a1bb0a6e
1 changed files with 2 additions and 0 deletions

View File

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