summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-06-04 10:48:25 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-06-04 10:48:25 -0400
commit260e998bcd6be13c02ad5962264cb11fe5244771 (patch)
tree1826b2432a5b3998c0440cb3514e88f4b594e725
parent94a3fd9cdedc528fda366a579f8e30ff7711c397 (diff)
node-2d: Fix default-width/height when there is no texture set.
-rw-r--r--catbird/node-2d.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm
index 79a0dba..6e9c197 100644
--- a/catbird/node-2d.scm
+++ b/catbird/node-2d.scm
@@ -818,10 +818,12 @@ PADDING on all sides."
#:init-form blend:alpha))
(define-method (default-width (sprite <sprite>))
- (texture-width (texture sprite)))
+ (let ((t (texture sprite)))
+ (if t (texture-width t) 0.0)))
(define-method (default-height (sprite <sprite>))
- (texture-height (texture sprite)))
+ (let ((t (texture sprite)))
+ (if t (texture-height t) 0.0)))
(define-method (on-change (sprite <sprite>) slot-name old new)
(case slot-name