diff --git a/collects/2htdp/private/image-more.rkt b/collects/2htdp/private/image-more.rkt index c332298551..6aa9b7fe89 100644 --- a/collects/2htdp/private/image-more.rkt +++ b/collects/2htdp/private/image-more.rkt @@ -336,7 +336,8 @@ (make-line-segment (make-point x1 y1) (make-point x2 y2) color)) (image-shape image)) (image-bb image) - #f))) + #f + (send image get-pinhole)))) (define/chk (scene+curve image x1 y1 angle1 pull1 x2 y2 angle2 pull2 color) (let* ([dx (abs (min 0 x1 x2))] @@ -348,7 +349,8 @@ color)) (image-shape image)) (image-bb image) - #f))) + #f + (send image get-pinhole)))) ;; frame : image -> image ;; draws a black frame around a image where the bounding box is @@ -845,7 +847,8 @@ (make-line-segment (make-point x1 y1) (make-point x2 y2) color) (image-shape image))) (make-bb right bottom baseline) - #f))) + #f + (send image get-pinhole)))) (define/chk (add-curve image x1 y1 angle1 pull1 x2 y2 angle2 pull2 color) (let* ([dx (abs (min 0 x1 x2))] @@ -865,7 +868,8 @@ color) (image-shape image))) (make-bb right bottom baseline) - #f))) + #f + (send image get-pinhole)))) ;; this is just so that 'text' objects can be sized. (define text-sizing-bm (make-object bitmap-dc% (make-object bitmap% 1 1))) diff --git a/collects/2htdp/tests/test-image.rkt b/collects/2htdp/tests/test-image.rkt index 2aa8ad41dc..7831f77903 100644 --- a/collects/2htdp/tests/test-image.rkt +++ b/collects/2htdp/tests/test-image.rkt @@ -1626,6 +1626,46 @@ (put-pinhole 5 6 (rectangle 10 12 'solid 'blue))) => #t) +(test (pinhole-x (add-line (center-pinhole (rectangle 100 120 'solid 'red)) 10 10 20 20 'blue)) + => + 50) +(test (pinhole-y (add-line (center-pinhole (rectangle 100 120 'solid 'red)) 10 10 20 20 'blue)) + => + 60) +(test (pinhole-x (add-curve (center-pinhole (rectangle 100 120 'solid 'red)) + 10 10 30 1/2 + 20 20 60 1/2 + 'white)) + => + 50) +(test (pinhole-y (add-curve (center-pinhole (rectangle 100 120 'solid 'red)) + 10 10 30 1/2 + 20 20 60 1/2 + 'white)) + => + 60) + +(test (pinhole-x (scene+line (center-pinhole (rectangle 100 120 'solid 'red)) 10 10 20 20 'blue)) + => + 50) +(test (pinhole-y (scene+line (center-pinhole (rectangle 100 120 'solid 'red)) 10 10 20 20 'blue)) + => + 60) +(test (pinhole-x (scene+curve (center-pinhole (rectangle 100 120 'solid 'red)) + 10 10 30 1/2 + 20 20 60 1/2 + 'white)) + => + 50) +(test (pinhole-y (scene+curve (center-pinhole (rectangle 100 120 'solid 'red)) + 10 10 30 1/2 + 20 20 60 1/2 + 'white)) + => + 60) + +;; crop +;; frame ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;