summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/variant_op.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 9afc31a772..7389b7a71a 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -3542,7 +3542,10 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant &
case INT: {
int64_t va = a._data._int;
int64_t vb = b._data._int;
- r_dst = int((1.0 - c) * va + vb * c);
+ if (va != vb)
+ r_dst = int((1.0 - c) * va + vb * c);
+ else //avoid int casting issues
+ r_dst = a;
}
return;
case REAL: {