diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-20 10:04:59 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-20 10:04:59 -0500 |
commit | 613f3381583537033e03285ab3f9242bbfbeba65 (patch) | |
tree | edea9934e89bd5288d6de5d899b2514f52394e8a | |
parent | fdd4275c181fbf86c9cac01eb651fb6885cdf371 (diff) |
[modify] how apply-pen-at handles pen width
-rw-r--r-- | examples/12-canvas-drawing-language.lisp | 2 | ||||
-rw-r--r-- | src/canvas-language.lisp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/12-canvas-drawing-language.lisp b/examples/12-canvas-drawing-language.lisp index b4a621b..43d2dea 100644 --- a/examples/12-canvas-drawing-language.lisp +++ b/examples/12-canvas-drawing-language.lisp @@ -70,7 +70,7 @@ (list 0 0)) do (ww::fill-rel-bezier ls 12) - (ww::with-pen (:color (list 0 0 0 255)) + (ww::with-pen (:color (list 0 0 0 255) :width 1) (ww::stroke-rel-bezier ls 12))))) (defun draw-stuff (canvas) diff --git a/src/canvas-language.lisp b/src/canvas-language.lisp index 05cddfd..83e510f 100644 --- a/src/canvas-language.lisp +++ b/src/canvas-language.lisp @@ -109,14 +109,14 @@ saved by WITH-PEN-STATE" (defun apply-pen-at (x y) (let ((w - (max 0 (floor (* 0.5 *current-pen-width*))))) + (max 0 (1- *current-pen-width*)))) (destructuring-bind (cr cg cb ca) (etypecase *current-pen-color* (null (list 0 0 0 255)) (list *current-pen-color*) (function (funcall *current-pen-color* x y))) - (with-grid-rect (rx ry) ((- x w) (- y w) (+ x w) (+ y w)) + (with-grid-rect (rx ry) (x y (+ x w) (+ y w)) (when (can-fill-canvas-at-p rx ry) (with-pixel (r g b a) (pixel *current-canvas* rx ry) (setf r cr g cg b cb a ca))))))) |