Skip to content

Commit 8758b43

Browse files
committed
#16 cleanup
1 parent 2f421a0 commit 8758b43

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Sources/vger/sdf.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,33 +409,31 @@ inline float sdPrim(const DEVICE vgerPrim& prim, const DEVICE float2* cvs, float
409409
auto b = cvs[j+1];
410410
auto c = cvs[j+2];
411411

412-
bool skip = false;
412+
bool close = true;
413413
auto xmax = p.x + filterWidth;
414414
auto xmin = p.x - filterWidth;
415415

416416
// If the hull is far enough away, don't bother with
417417
// a sdf.
418418
if(a.x > xmax and b.x > xmax and c.x > xmax) {
419-
skip = true;
419+
close = false;
420420
} else if(a.x < xmin and b.x < xmin and c.x < xmin) {
421-
skip = true;
421+
close = false;
422422
}
423423

424-
if(!skip) {
424+
if(close) {
425425
d = min(d, udBezier(p, a, b, c));
426-
}
427-
428-
if(lineTest(p, a, c)) {
429-
s = -s;
430-
}
431426

432-
// Flip if inside area between curve and line.
433-
if(!skip) {
427+
// Flip if inside area between curve and line.
434428
if(bezierTest(p, a, b, c)) {
435429
s = -s;
436430
}
437431
}
438432

433+
if(lineTest(p, a, c)) {
434+
s = -s;
435+
}
436+
439437
}
440438
d *= s;
441439
break;

0 commit comments

Comments
 (0)