diff options
| author | Juan Linietsky | 2015-05-21 15:02:49 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-05-21 15:02:49 -0300 |
| commit | bb5d46bb113bca3204db7678eb69900f159e8087 (patch) | |
| tree | cd34e10d67a196d217559ab8d4973b8f5bc4ccde /core/variant_op.cpp | |
| parent | 4b8745ad63409cf14b02735981ee35d2f794421c (diff) | |
| parent | 6049479a99f66b620d59498a76ed9f2c3891f4c8 (diff) | |
| download | godot-bb5d46bb113bca3204db7678eb69900f159e8087.tar.gz godot-bb5d46bb113bca3204db7678eb69900f159e8087.tar.zst godot-bb5d46bb113bca3204db7678eb69900f159e8087.zip | |
Diffstat (limited to 'core/variant_op.cpp')
| -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 f68652b8c..1cdf6d731 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; } |
