summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2020-07-23 22:59:04 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2020-07-23 22:59:04 +0200
commite1a1bb0a6ef14a809395a239f661db20b52a9f0e (patch)
tree3830985da3be07cb2b8157ebcda5771b6045600e /scene
parent3c6f5226f7ce546ea1f0ec810543b18aa43822e2 (diff)
Keep transition value when replacing key
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/animation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 479d97aadc..b8edd70712 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -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.