diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-20 10:00:34 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-20 10:00:34 -0500 |
commit | fdd4275c181fbf86c9cac01eb651fb6885cdf371 (patch) | |
tree | 711d2870fee30d20a7dd27fbff573ab553f9d29a /src | |
parent | 1b5440df2b7dc87c1088fc3842195dbd576276ff (diff) |
[add] fill bezier. [example] tweaking
Diffstat (limited to 'src')
-rw-r--r-- | src/canvas-language.lisp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/canvas-language.lisp b/src/canvas-language.lisp index 610c8e0..05cddfd 100644 --- a/src/canvas-language.lisp +++ b/src/canvas-language.lisp @@ -196,3 +196,14 @@ saved by WITH-PEN-STATE" (stroke-bezier (cons *current-pen-position* (rel-to-current-pos rel-control-points)) curve-samples)) + +(defun fill-bezier (control-pts &optional (curve-samples 10)) + (let (path) + (with-grid-bezier (x y) (control-pts :count curve-samples) + (push (list x y) path)) + (fill-path (reverse path)))) + +(defun fill-rel-bezier (rel-control-points &optional (curve-samples 10)) + (fill-bezier (cons *current-pen-position* + (rel-to-current-pos rel-control-points)) + curve-samples)) |