diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-16 18:16:11 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-16 18:16:11 -0300 |
commit | adb709aa91306ea6dab179c1a98173283129e7e5 (patch) | |
tree | 2fb38ca3e0b6a7abd9f90ad0bb7033c3a563241b | |
parent | bbe9a37f1d0bae1b26b9f53b216c29d16e76b039 (diff) | |
download | redot-engine-adb709aa91306ea6dab179c1a98173283129e7e5.tar.gz |
-Integers and Float should interpolate on animation, maybe fixes #1891, please test
-rw-r--r-- | core/variant_op.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index f68652b8cc..1cdf6d7319 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3388,7 +3388,15 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst) { if (a.type!=b.type) { - r_dst=a; + if (a.is_num() && b.is_num()) { + //not as efficient but.. + real_t va=a; + real_t vb=b; + r_dst=(1.0-c) * va + vb * c; + + } else { + r_dst=a; + } return; } |