Fixed floating point issue in find() of animation.

Fixes #23504
This commit is contained in:
DualMatrix 2018-11-10 14:21:40 +01:00
parent 531dc2f435
commit b4315abb71

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