From fdd4275c181fbf86c9cac01eb651fb6885cdf371 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 20 Jul 2022 10:00:34 -0500 Subject: [add] fill bezier. [example] tweaking --- src/canvas-language.lisp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/canvas-language.lisp') 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)) -- cgit v1.2.3