dc-for-text-size

This commit is contained in:
Jay McCarthy 2014-11-19 23:04:33 -05:00
parent 7204b221ee
commit 7a4ce679cd
1 changed files with 14 additions and 13 deletions

View File

@ -25,19 +25,20 @@
(super-output! (super-output!
(gui/val-g c) (gui/val-g c)
(λ (w h dc) (λ (w h dc)
(send dc set-background "black") (parameterize ([dc-for-text-size dc])
(send dc clear) (send dc set-background "black")
(define sp (send dc clear)
(if (gui/val-scale? c) (define sp
(scale-to-fit p w h) (if (gui/val-scale? c)
p)) (scale-to-fit p w h)
(define spw (pict-width sp)) p))
(define left (/ (- w spw) 2)) (define spw (pict-width sp))
(define sph (pict-height sp)) (define left (/ (- w spw) 2))
(define top (/ (- h sph) 2)) (define sph (pict-height sp))
(send dc set-brush "white" 'solid) (define top (/ (- h sph) 2))
(send dc draw-rectangle left top spw sph) (send dc set-brush "white" 'solid)
(draw-pict sp dc left top)))) (send dc draw-rectangle left top spw sph)
(draw-pict sp dc left top)))))
(define (chaos-label! c l) (define (chaos-label! c l)
(super-label! (gui/val-g c) l)) (super-label! (gui/val-g c) l))
(define (chaos-swap! c t) (define (chaos-swap! c t)