Fix: Incorrect assert conditions in NURBSpline

This fix provides better conditions for asserts in `NURBSpline::knots`
method accounting for cyclic NURBS curves.

Differential Revision: https://developer.blender.org/D13620
This commit is contained in:
Piotr Makal 2021-12-20 12:43:14 -06:00 committed by Hans Goudey
parent 76cb11e332
commit 70de992afe
1 changed files with 2 additions and 2 deletions

View File

@ -257,13 +257,13 @@ void NURBSpline::calculate_knots() const
Span<float> NURBSpline::knots() const
{
if (!knots_dirty_) {
BLI_assert(knots_.size() == this->size() + order_);
BLI_assert(knots_.size() == this->knots_size());
return knots_;
}
std::lock_guard lock{knots_mutex_};
if (!knots_dirty_) {
BLI_assert(knots_.size() == this->size() + order_);
BLI_assert(knots_.size() == this->knots_size());
return knots_;
}