2htdp/image: place-image/align doesn't really need to check that the second image argument has a pinhole

This commit is contained in:
Robby Findler 2011-02-06 07:24:19 -06:00
parent 5017801659
commit eb45a6f15b
2 changed files with 14 additions and 15 deletions

View File

@ -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))

View File

@ -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"