summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-12-13 08:35:32 -0500
committerDavid Thompson <dthompson2@worcester.edu>2022-12-14 12:57:02 -0500
commit81f8add3c8e66e875d523344fd35b899676e943f (patch)
treea9daa2ef366eba7a9c2b89fbced484bb11eb01b4
parent3946134e5d9e153461abe219ebc5b0721aaeb7e7 (diff)
scene: Add width/height methods.
-rw-r--r--catbird/scene.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/catbird/scene.scm b/catbird/scene.scm
index 7f2542d..046a8dd 100644
--- a/catbird/scene.scm
+++ b/catbird/scene.scm
@@ -209,3 +209,9 @@
(define-method (resume (scene <scene>))
(for-each-child resume scene)
(next-method))
+
+(define-method (width (scene <scene>))
+ (fold (lambda (r w) (max w (width r))) 0.0 (regions scene)))
+
+(define-method (height (scene <scene>))
+ (fold (lambda (r h) (max h (height r))) 0.0 (regions scene)))