From 260e998bcd6be13c02ad5962264cb11fe5244771 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 4 Jun 2023 10:48:25 -0400 Subject: node-2d: Fix default-width/height when there is no texture set. --- catbird/node-2d.scm | 6 ++++-- 1 file 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 )) - (texture-width (texture sprite))) + (let ((t (texture sprite))) + (if t (texture-width t) 0.0))) (define-method (default-height (sprite )) - (texture-height (texture sprite))) + (let ((t (texture sprite))) + (if t (texture-height t) 0.0))) (define-method (on-change (sprite ) slot-name old new) (case slot-name -- cgit v1.2.3