From 966cfb53458e3aad27a092fcebd804a2fce6f474 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 18 Dec 2022 19:57:39 -0500 Subject: node-2d: Use resize method. --- catbird/node-2d.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm index 84c86d8..a390201 100644 --- a/catbird/node-2d.scm +++ b/catbird/node-2d.scm @@ -765,8 +765,9 @@ A." (case slot-name ((texture) (let ((new (artifact (->asset new)))) - (set! (width sprite) (texture-width new)) - (set! (height sprite) (texture-height new)))))) + (resize sprite + (texure-width new) + (texture-height new)))))) (define-method (render (sprite ) alpha) (let ((t (texture sprite))) @@ -920,8 +921,7 @@ A." (set-canvas-painter! (canvas c) p) ;; (set! (origin-x canvas) (- (rect-x bb))) ;; (set! (origin-y canvas) (- (rect-y bb))) - (set! (width c) (rect-width bb)) - (set! (height c) (rect-height bb)))))) + (resize c (rect-width bb) (rect-height bb)))))) (define-method (on-boot (c )) (refresh-painter c)) @@ -977,8 +977,7 @@ A." (page-reset! p) (page-write! p c) (let ((bb (page-bounding-box p))) - (set! (width label) (rect-width bb)) - (set! (height label) (rect-height bb))) + (resize label (rect-width bb) (rect-height bb))) (realign label))) (define-method (on-boot (label