aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interactive/canvas.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-07-28 09:38:35 -0500
committerColin Okay <colin@cicadas.surf>2022-07-28 09:38:35 -0500
commitfdfee6053fb8430566eb7a9960b77cf28826aa01 (patch)
treec372850aaa0a6c50b485ec61abd2db873ad9d096 /src/interactive/canvas.lisp
parent259b8df3630487055f5d3e1bc98d245973b3a95e (diff)
[add] canvas-paint example; [refactor] with-current-pen
Diffstat (limited to 'src/interactive/canvas.lisp')
-rw-r--r--src/interactive/canvas.lisp5
1 files changed, 3 insertions, 2 deletions
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