From fdfee6053fb8430566eb7a9960b77cf28826aa01 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 28 Jul 2022 09:38:35 -0500 Subject: [add] canvas-paint example; [refactor] with-current-pen --- src/interactive/canvas.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/interactive/canvas.lisp') diff --git a/src/interactive/canvas.lisp b/src/interactive/canvas.lisp index d870ae8..977e3ec 100644 --- a/src/interactive/canvas.lisp +++ b/src/interactive/canvas.lisp @@ -3,7 +3,7 @@ (in-package #:wheelwork) (defclass/std pixels () - ((pixel-width pixel-height :std (error "pixel-width and pixel-height are required")) + ((pixel-width pixel-height :std (error "pixel-width and pixel-height are required")) (data :a :with :doc "Array of RGBA data representing an image of pixel-width X pixel-height"))) (defmethod initialize-instance :after ((pixels pixels) &key) @@ -23,7 +23,8 @@ I.E. If you are are wanting to manipulate more than one pixel at a time, you should get those pixels with USE-CACHED set to NIL." - (with-slots (pixel-width pixel-height data) pixels + (let ((pixel-width (pixel-width pixels)) + (data (pixels-data pixels))) (cond ((and use-cached cached-pixel) (adjust-array cached-pixel 4 -- cgit v1.2.3