aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-07-20 17:01:26 -0500
committerColin Okay <colin@cicadas.surf>2022-07-20 17:01:26 -0500
commit4da8c16d60a61eff5a1cb03e6573a4d43b3abd09 (patch)
treea527e12db68060b81bdd2430ddb0d3ede1d384c3 /src
parent030111b871ab1a75f299411b8e9cadad13d06b8d (diff)
[refactor] odd behavior in with-grid-bezier
Diffstat (limited to 'src')
-rw-r--r--src/grid-geometry.lisp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/grid-geometry.lisp b/src/grid-geometry.lisp
index 5fdfdd8..3597e75 100644
--- a/src/grid-geometry.lisp
+++ b/src/grid-geometry.lisp
@@ -102,7 +102,7 @@ top right corners of the bounding box for POLY "
(defmacro with-grid-bezier
- ((x y) (control-pts &key (count 1000)) &body body)
+ ((x y) (control-pts &key (count 100)) &body body)
"CONTROL-POINTS is an expression that evalueates to a list of (X Y)
pairs, these are the control points for the curve.. COUNT is the
number of points on the bezier curve that will be calclated. The first
@@ -118,7 +118,7 @@ Evaluates the BODY with X Y bound to a point on the bezier curve.
,control-pts)
(,fn
(apply #'bezier-lambda ,points)))
- (loop for ,a from 0.0 to 1.0 by ,step
- for (,x ,y) = (mapcar #'round (funcall ,fn ,a))
+ (loop for ,a from 0.0 to (+ 1.0 ,step) by ,step
+ for (,x ,y) = (mapcar #'round (funcall ,fn (clamp 0 ,a 1.0)))
do ,@body))))