diff options
-rw-r--r-- | catbird/node-2d.scm | 18 |
1 files 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 <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 <canvas>)) (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 <label>)) @@ -1030,10 +1029,9 @@ A." (define-method (on-boot (particles <particles>)) ;; Default bounding box size. - (when (zero? (width particles)) - (set! (width particles) 32.0)) - (when (zero? (height particles)) - (set! (height particles) 32.0))) + (resize particles + (if (zero? (width particles)) 32.0 (width particles)) + (if (zero? (height particles)) 32.0 (height particles)))) (define-method (update (node <particles>) dt) (update-particles (particles node))) |