Fix an off-by-one error that missed the last point when generating screen bounding boxes

This commit is contained in:
Koen Schmeets 2020-12-21 16:03:42 +01:00 committed by ruevs
parent 0e5a246a70
commit 679e2b9202

View File

@ -70,7 +70,7 @@ BBox Entity::GetOrGenerateScreenBBox(bool *hasBBox) {
Vector first = SS.GW.ProjectPoint3(sbl->l[0].ctrl[0]);
screenBBox = BBox::From(first, first);
for(auto &sb : sbl->l) {
for(int i = 0; i < sb.deg; ++i) { screenBBox.Include(SS.GW.ProjectPoint3(sb.ctrl[i])); }
for(int i = 0; i <= sb.deg; ++i) { screenBBox.Include(SS.GW.ProjectPoint3(sb.ctrl[i])); }
}
} else
ssassert(false, "Expected entity to be a point or have beziers");