Merge pull request #23632 from DualMatrix/floating_point

Fixed floating point issue in find() of animation.
This commit is contained in:
Rémi Verschelde 2018-11-10 23:25:59 +01:00 committed by GitHub
commit c3023e84c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1469,7 +1469,7 @@ int Animation::_find(const Vector<K> &p_keys, float p_time) const {
middle = (low + high) / 2;
if (p_time == keys[middle].time) { //match
if (Math::abs(p_time - keys[middle].time) < CMP_EPSILON) { //match
return middle;
} else if (p_time < keys[middle].time)
high = middle - 1; //search low end of array