diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-03-26 09:55:34 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-03-26 09:55:34 -0400 |
commit | 2274835aa52d3803451060e11de296ad1dd9b51f (patch) | |
tree | 3e045543fec4e836107282bf87a9f60c494dc9b3 | |
parent | 6030c8533dbecce1f309efaa7b0d8ba8a1b6ced2 (diff) |
Auto-resize REPL background.
-rw-r--r-- | catbird/repl.scm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/catbird/repl.scm b/catbird/repl.scm index 29228d0..7378ecf 100644 --- a/catbird/repl.scm +++ b/catbird/repl.scm @@ -110,13 +110,15 @@ (module-name (module repl))))) (define-method (resize-repl (repl <repl>) w h) - (set! (width repl) w) - (set! (height repl) h) - (set! (painter (& repl background)) - (with-style ((fill-color %background-color)) - (fill - (rectangle (vec2 0.0 0.0) w h)))) - (refresh-log repl)) + (let ((bg (& repl background))) + (set! (width repl) w) + (set! (height repl) h) + (set! (painter bg) + (with-style ((fill-color %background-color)) + (fill + (rectangle (vec2 0.0 0.0) w h)))) + (resize bg) + (refresh-log repl))) (define-method (repl-read-expression (repl <repl>) line) (call-with-input-string line |