summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 10:31:07 +0200
committerGitHub <noreply@github.com>2018-10-07 10:31:07 +0200
commitc27b2adb10ea7077008d4f8b356e3561d05bad6a (patch)
treed308669b3ce2ec78564e640fd67d957b1c775415 /core
parentcb339bfffbca8786adae221b948618b048b29f6c (diff)
parentbbfc6f698511dfdfa44e61aa88bd5678dda06bd8 (diff)
Merge pull request #22786 from qonnop/fix-int-interpolation
Fixed int interpolation issue, closes #22763
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: {