diff options
author | David Thompson <dthompson2@worcester.edu> | 2022-12-27 12:11:18 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2022-12-28 12:18:33 -0500 |
commit | de9fe35b94afe0225d721a7c5f29b7b34b125581 (patch) | |
tree | b049c3ecf16e872b48712a23ca127d348413597d | |
parent | 761a0f71e62da694d05895873c91abff70d8ec23 (diff) |
node-2d: Short-circuit resize if size hasn't actually changed.
-rw-r--r-- | catbird/node-2d.scm | 11 |
1 files 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 <node-2d>) 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))) ;;; |