Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Stanton <abstanton>2021-07-18 18:59:23 +0300
committerHans Goudey <h.goudey@me.com>2021-07-18 18:59:23 +0300
commit9eafdb985d4b45a441164ff86a212a4cc6b29a09 (patch)
treeb5a3d8d32043cb8fa92876ab5d2f2a714fdbc799 /source/blender/blenkernel/intern/spline_base.cc
parent3c8d261557e0b76d2d97902ade5668b6044227b6 (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/spline_base.cc')
-rw-r--r--source/blender/blenkernel/intern/spline_base.cc2
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);