summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-12-15 08:53:09 -0500
committerDavid Thompson <dthompson2@worcester.edu>2022-12-15 08:53:09 -0500
commit0cbe11133c71cd853a3653a848edcf62a9d8b6b1 (patch)
tree42f104cb6b725e388e3889cff2f4f5082334f7e3
parent57cde916fb7b0794dd44382b0526336c654afddd (diff)
node-2d: sprite: Fix on-change asset bug.
-rw-r--r--catbird/node-2d.scm5
1 files 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 <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 <sprite>) alpha)
(let ((t (texture sprite)))