From 7a4ce679cd3143493602c91cf2f5ce102f57df76 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Wed, 19 Nov 2014 23:04:33 -0500 Subject: [PATCH] dc-for-text-size --- chaos/gui/val.rkt | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/chaos/gui/val.rkt b/chaos/gui/val.rkt index 1856592..15f2484 100644 --- a/chaos/gui/val.rkt +++ b/chaos/gui/val.rkt @@ -25,19 +25,20 @@ (super-output! (gui/val-g c) (λ (w h dc) - (send dc set-background "black") - (send dc clear) - (define sp - (if (gui/val-scale? c) - (scale-to-fit p w h) - p)) - (define spw (pict-width sp)) - (define left (/ (- w spw) 2)) - (define sph (pict-height sp)) - (define top (/ (- h sph) 2)) - (send dc set-brush "white" 'solid) - (send dc draw-rectangle left top spw sph) - (draw-pict sp dc left top)))) + (parameterize ([dc-for-text-size dc]) + (send dc set-background "black") + (send dc clear) + (define sp + (if (gui/val-scale? c) + (scale-to-fit p w h) + p)) + (define spw (pict-width sp)) + (define left (/ (- w spw) 2)) + (define sph (pict-height sp)) + (define top (/ (- h sph) 2)) + (send dc set-brush "white" 'solid) + (send dc draw-rectangle left top spw sph) + (draw-pict sp dc left top))))) (define (chaos-label! c l) (super-label! (gui/val-g c) l)) (define (chaos-swap! c t)