From 0cbe11133c71cd853a3653a848edcf62a9d8b6b1 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 15 Dec 2022 08:53:09 -0500 Subject: node-2d: sprite: Fix on-change asset bug. --- catbird/node-2d.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm index 05393fa..b2f60c6 100644 --- a/catbird/node-2d.scm +++ b/catbird/node-2d.scm @@ -767,8 +767,9 @@ A." (define-method (on-change (sprite ) slot-name old new) (case slot-name ((texture) - (set! (width sprite) (texture-width new)) - (set! (height sprite) (texture-height new))))) + (let ((new (artifact (->asset new)))) + (set! (width sprite) (texture-width new)) + (set! (height sprite) (texture-height new)))))) (define-method (render (sprite ) alpha) (let ((t (texture sprite))) -- cgit v1.2.3