From e0fc8f0f7a8b4756226cfb5e1c7581e411420228 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 30 Jun 2022 07:35:16 -0500 Subject: [refactor] factored out affine from unit; made container a unit; --- examples/03-font-render.lisp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'examples/03-font-render.lisp') diff --git a/examples/03-font-render.lisp b/examples/03-font-render.lisp index 6f7d1a7..e36dc44 100644 --- a/examples/03-font-render.lisp +++ b/examples/03-font-render.lisp @@ -16,15 +16,15 @@ (format t "Pressed a key, changing the color~%") (setf (ww::text-color target) (random-text-color)) - (with-accessors ((x ww::unit-x) (y ww::unit-y) (w ww::unit-width) (h ww::unit-height)) target + (with-accessors ((x ww::x) (y ww::y) (w ww::unit-width) (h ww::unit-height)) target (format t "x:~a,y:~a,width:~a,height:~a~%" x y w h)))) (ww::defhandler marquee (ww::on-perframe () - (when (< 900 (ww::unit-x target)) - (setf (ww::unit-x target) + (when (< 900 (ww::x target)) + (setf (ww::x target) -800)) - (incf (ww::unit-x target) 5 ))) + (incf (ww::x target) 5 ))) (defvar *spin-table* (make-hash-table :synchronized t)) @@ -36,9 +36,9 @@ (setf (gethash target *spin-table*) (+ rot 0.88) (ww::text-color target) (random-text-color) - (ww::unit-rotation target) rot) + (ww::rotation target) rot) (progn - (setf (ww::unit-rotation target) 0.0) + (setf (ww::rotation target) 0.0) (ww::remove-handler target #'spin) (remhash target *spin-table*)))))) @@ -61,8 +61,8 @@ (ww::scale-by hello 3.0) (setf - (ww::unit-x hello) (* 0.5 (- 800 (ww::unit-width hello))) - (ww::unit-y hello) (* 0.5 (- 600 (ww::unit-height hello)))) + (ww::x hello) (* 0.5 (- 800 (ww::unit-width hello))) + (ww::y hello) (* 0.5 (- 600 (ww::unit-height hello)))) (ww::add-handler hello #'marquee) (ww::add-handler hello #'change-text-color) (ww::add-handler hello #'twirl-on-click) @@ -71,7 +71,7 @@ (ww::scale-by instructions 2.0) (setf - (ww::unit-x instructions) (* 0.5 (- 800 (ww::unit-width instructions)))) + (ww::x instructions) (* 0.5 (- 800 (ww::unit-width instructions)))) (ww::add-unit app instructions))) -- cgit v1.2.3