From de9fe35b94afe0225d721a7c5f29b7b34b125581 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 27 Dec 2022 12:11:18 -0500 Subject: node-2d: Short-circuit resize if size hasn't actually changed. --- catbird/node-2d.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm index 6e7eb41..41f82db 100644 --- a/catbird/node-2d.scm +++ b/catbird/node-2d.scm @@ -455,10 +455,13 @@ (next-method)) (define-method (resize (node ) w h) - (set! (width node) w) - (set! (height node) h) - (expire-local-bounding-box node) - (on-child-resize (parent node) node)) + ;; No-op if the size is the same. + (unless (and (= (width node) w) + (= (height node) h)) + (set! (width node) w) + (set! (height node) h) + (expire-local-bounding-box node) + (on-child-resize (parent node) node))) ;;; -- cgit v1.2.3