Merge pull request #22786 from qonnop/fix-int-interpolation

Fixed int interpolation issue, closes #22763
This commit is contained in:
Rémi Verschelde 2018-10-07 10:31:07 +02:00 committed by GitHub
commit c27b2adb10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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: {