Skip to content

Commit

Permalink
Keep transition value when replacing key
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jul 23, 2020
1 parent 3c6f522 commit e1a1bb0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/resources/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e1a1bb0

Please sign in to comment.