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 --- examples/12-canvas-drawing-language.lisp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/12-canvas-drawing-language.lisp b/examples/12-canvas-drawing-language.lisp index bece8c8..b4a621b 100644 --- a/examples/12-canvas-drawing-language.lisp +++ b/examples/12-canvas-drawing-language.lisp @@ -62,14 +62,16 @@ ;; curve. the curve uses two control points that are R away from ;; the starting point and PSW radians on either side of the line ;; at angle a - (loop for a from 0 to (* 2 pi) by (/ (* 2 pi) petals) do - (ww::stroke-rel-bezier - (list (list (* r (sin (- a psw))) + (loop for a from 0 to (* 2 pi) by (/ (* 2 pi) petals) + for ls = (list (list (* r (sin (- a psw))) (* r (cos (- a psw)))) (list (* r (sin (+ a psw))) (* r (cos (+ a psw)))) (list 0 0)) - 12)))) + do + (ww::fill-rel-bezier ls 12) + (ww::with-pen (:color (list 0 0 0 255)) + (ww::stroke-rel-bezier ls 12))))) (defun draw-stuff (canvas) (ww::with-canvas canvas @@ -86,10 +88,6 @@ ;; draw a flower (flower 28)) - - - ;; draw a bunch of triangles - (ww::canvas-pen-width 1) (dotimes (x 50) (when (evenp x) (triangle-at 30 (+ 250 x)))))) -- cgit v1.2.3