From ad54c93d8e66765a9642dba233adb98859d96a4c Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 17 Aug 2009 15:57:01 +0000 Subject: [PATCH] identified a problem with normalization (not sure how to fix it yet, tho) svn: r15770 original commit: efbd58d93ed856553f31f04422713e08ccdee285 --- collects/2htdp/private/picture.ss | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/collects/2htdp/private/picture.ss b/collects/2htdp/private/picture.ss index 8f75bfd8..fa34499f 100644 --- a/collects/2htdp/private/picture.ss +++ b/collects/2htdp/private/picture.ss @@ -203,8 +203,8 @@ and they all have good sample contracts. (It is amazing what we can do with kids (+ dy (posn-y posn)) θ)]) (set! left (min new-x left)) - (set! right (max new-x right)) (set! top (min new-y top)) + (set! right (max new-x right)) (set! bottom (max new-y bottom)))) (cdr points)) (values left top right bottom))))] @@ -398,8 +398,8 @@ and they all have good sample contracts. (It is amazing what we can do with kids (λ (f) (send sl set-value (max min-scale (min max-scale (f (send sl get-value))))) (send c refresh))]) - (new button% [label "√"] [callback (λ x (scale-adjust sub1))] [parent bp]) - (new button% [label "²"] [callback (λ x (scale-adjust add1))] [parent bp]) + (send (new button% [label "√"] [callback (λ x (scale-adjust sub1))] [parent bp]) min-width 100) + (send (new button% [label "²"] [callback (λ x (scale-adjust add1))] [parent bp]) min-width 100) (send f show #t))) ;; render-picture : normalized-shape dc dx dy -> void @@ -603,6 +603,9 @@ and they all have good sample contracts. (It is amazing what we can do with kids ;; rotate/places : string string I number -> I ;; rotates the I around the given point inside the I, using ;; the strings like overlay does. + +;; this function is bogus! It doesn't matter where you rotate it around. it still looks the same! + (define/chk (rotate/places x-place y-place angle picture) (rotate/internal x-place y-place angle picture)) @@ -618,7 +621,7 @@ and they all have good sample contracts. (It is amazing what we can do with kids (set! top (if top (min this-top top) this-top)) (set! right (if right (max this-right right) this-right)) (set! bottom (if bottom (max this-bottom bottom) this-bottom)))) - (let ([rotated (normalize-shape (make-rotate angle (picture-shape picture)) add-to-bounding-box)]) + (let* ([rotated (normalize-shape (make-rotate angle (picture-shape picture)) add-to-bounding-box)]) (make-picture (make-translate (- left) (- top) rotated) (make-bb (- right left) (- bottom top) (- bottom top)) #f))) @@ -690,3 +693,20 @@ and they all have good sample contracts. (It is amazing what we can do with kids ;; see pin-line in slideshow ;; the initial strings in the second instance of add-curve are like the strings in add-line +(let* ([first (rectangle 100 10 'solid 'red)] + [second + (overlay/places 'center + 'center + first + (rotate/places 'center 'center + (* pi 1/4) + first))] + [third + (overlay/places 'center + 'center + (frame second) + (rotate/places 'center 'center + (* pi 1/8) + (frame second)))]) + (show-picture (frame (rotate (* pi 1/8) + (rotate (* pi 1/8) first)))))