From adb709aa91306ea6dab179c1a98173283129e7e5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 16 May 2015 18:16:11 -0300 Subject: -Integers and Float should interpolate on animation, maybe fixes #1891, please test --- core/variant_op.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3