Browse Source

Keep transition value when replacing key

(cherry picked from commit e1a1bb0a6ef14a809395a239f661db20b52a9f0e)
Tomasz Chabora 5 years ago
parent
commit
307bac0757
1 changed files with 2 additions and 1 deletions
  1. 2 1
      scene/resources/animation.cpp

+ 2 - 1
scene/resources/animation.cpp

@@ -821,8 +821,9 @@ int Animation::_insert(float p_time, T &p_keys, const V &p_value) {
 
 
 		// 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.