diff options
author | Angus Stanton <abstanton> | 2021-07-18 18:59:23 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-18 18:59:23 +0300 |
commit | 9eafdb985d4b45a441164ff86a212a4cc6b29a09 (patch) | |
tree | b5a3d8d32043cb8fa92876ab5d2f2a714fdbc799 /source/blender/blenkernel/intern | |
parent | 3c8d261557e0b76d2d97902ade5668b6044227b6 (diff) |
Fix: Incorrect logic in spline lookup function
This section of code deals with evaluated points,
so that is the size it should use.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/spline_base.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index 6234cdf87e2..a7caae967f6 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -410,7 +410,7 @@ Spline::LookupResult Spline::lookup_evaluated_length(const float length) const const float *offset = std::lower_bound(lengths.begin(), lengths.end(), length); const int index = offset - lengths.begin(); - const int next_index = (index == this->size() - 1) ? 0 : index + 1; + const int next_index = (index == this->evaluated_points_size() - 1) ? 0 : index + 1; const float previous_length = (index == 0) ? 0.0f : lengths[index - 1]; const float factor = (length - previous_length) / (lengths[index] - previous_length); |