From eb45a6f15b5ab6d013bed62041ecd7240d561fb3 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 6 Feb 2011 07:24:19 -0600 Subject: [PATCH] 2htdp/image: place-image/align doesn't really need to check that the second image argument has a pinhole --- collects/2htdp/private/image-more.rkt | 5 ++--- collects/2htdp/tests/test-image.rkt | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/collects/2htdp/private/image-more.rkt b/collects/2htdp/private/image-more.rkt index 0473b17dd1..f6b16c5c18 100644 --- a/collects/2htdp/private/image-more.rkt +++ b/collects/2htdp/private/image-more.rkt @@ -382,9 +382,8 @@ (define/chk (place-image/align image1 x1 y1 x-place y-place image2) (when (or (eq? x-place 'pinhole) (eq? y-place 'pinhole)) (check-dependencies 'place-image/align - (and (send image1 get-pinhole) - (send image2 get-pinhole)) - "when x-place or y-place is ~e or ~e, then both of the image arguments must have pinholes" + (send image1 get-pinhole) + "when x-place or y-place is ~e or ~e, the the first image argument must have a pinhole" 'pinhole "pinhole")) (place-image/internal image1 x1 y1 image2 x-place y-place)) diff --git a/collects/2htdp/tests/test-image.rkt b/collects/2htdp/tests/test-image.rkt index 70a70f2af8..d50bc28cdd 100644 --- a/collects/2htdp/tests/test-image.rkt +++ b/collects/2htdp/tests/test-image.rkt @@ -1891,6 +1891,17 @@ 0 0 "center" "center" (rectangle 10 100 'solid 'blue))) +(test (clear-pinhole + (place-image/align + (center-pinhole (rectangle 100 10 'solid 'red)) + 0 0 "pinhole" "pinhole" + (rectangle 10 100 'solid 'blue))) + => + (place-image/align + (rectangle 100 10 'solid 'red) + 0 0 "center" "center" + (rectangle 10 100 'solid 'blue))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; test errors. @@ -2030,18 +2041,7 @@ => #rx"^underlay/align") -(test/exn (place-image/align - (center-pinhole (rectangle 10 100 'solid 'blue)) - 0 0 "pinhole" "center" - (rectangle 100 10 'solid 'red)) - => - #rx"^place-image/align") -(test/exn (place-image/align - (center-pinhole (rectangle 10 100 'solid 'blue)) - 0 0 "center" "pinhole" - (rectangle 100 10 'solid 'red)) - => - #rx"^place-image/align") + (test/exn (place-image/align (rectangle 100 10 'solid 'red) 0 0 "pinhole" "center"