From 5d808e9b44a1f42db3cb362ca08d3321e69444c8 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 28 Sep 2009 16:26:03 +0000 Subject: [PATCH] first (broken) attempt at bounding boxes for ellipses svn: r16145 original commit: 53a796d7af5fb7befa0d490da46ab4d5959b0722 --- collects/2htdp/private/image-core.ss | 36 +--------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/collects/2htdp/private/image-core.ss b/collects/2htdp/private/image-core.ss index ba07dbeb..eefb4c86 100644 --- a/collects/2htdp/private/image-core.ss +++ b/collects/2htdp/private/image-core.ss @@ -371,40 +371,6 @@ and they all have good sample contracts. (It is amazing what we can do with kids ; ; -(define (show-image g [extra-space 0]) - (letrec ([f (new frame% [label ""])] - [c (new canvas% - [parent f] - [min-width (+ extra-space (inexact->exact (floor (image-right g))))] - [min-height (+ extra-space (inexact->exact (floor (image-bottom g))))] - [paint-callback - (λ (c dc) - (send dc set-smoothing 'aligned) - (let-values ([(w h) (send c get-client-size)]) - (let ([scale (send sl get-value)]) - (send dc set-scale scale scale) - (render-image - g - dc - (inexact->exact (floor (- (/ w 2 scale) (/ (image-right g) 2)))) - (inexact->exact (floor (- (/ h 2 scale) (/ (image-bottom g) 2))))))))])] - [min-scale 1] - [max-scale 10] - [sl (new slider% - [label "Scale factor"] - [parent f] - [min-value min-scale] - [max-value max-scale] - [callback (λ ignore (send c refresh))])] - [bp (new horizontal-panel% [parent f] [alignment '(center center)] [stretchable-height #f])] - [scale-adjust - (λ (f) - (send sl set-value (max min-scale (min max-scale (f (send sl get-value))))) - (send c refresh))]) - (send (new button% [label "√"] [callback (λ x (scale-adjust sub1))] [parent bp]) min-width 100) - (send (new button% [label "2"] [callback (λ x (scale-adjust add1))] [parent bp]) min-width 100) - (send f show #t))) - ;; render-image : normalized-shape dc dx dy -> void (define (render-image image dc dx dy) (let loop ([shape (send image get-normalized-shape)]) @@ -484,4 +450,4 @@ and they all have good sample contracts. (It is amazing what we can do with kids image-bottom image-baseline - show-image) \ No newline at end of file + render-image) \ No newline at end of file