From 2274835aa52d3803451060e11de296ad1dd9b51f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 26 Mar 2023 09:55:34 -0400 Subject: Auto-resize REPL background. --- catbird/repl.scm | 16 +++++++++------- 1 file 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 ) 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 ) line) (call-with-input-string line -- cgit v1.2.3