[racket] Bug in place-image?

From: Miguel Villaverde (mvillaverde at gmail.com)
Date: Wed Dec 19 15:47:13 EST 2012

While working on HTDP2, I noticed the following: place-image seems to snip
the last column and row of pixels in its background image. This does not
happen when using overlay instead, or if the background is a scene.
place-image/align shows the same behavior:

(require 2htdp/image)

(define CIRCLE (circle 5 "solid" "red"))
(define RECTANGLE (rectangle 100 100 "outline" "black"))
(define SCENE (empty-scene 100 100))

(place-image CIRCLE 50 50 RECTANGLE)
(overlay CIRCLE RECTANGLE)
(place-image CIRCLE 50 50 SCENE)
(overlay CIRCLE SCENE)

(place-image/align CIRCLE 50 50 "center" "center" RECTANGLE)

If you run that, you'll notice the rectangle has lost its right and bottom
borders in the first and last images. This is using the beginner student
language in DrRacket 5.3.1.

Is this a bug? Is it intended behavior? If so, why?

BTW, what is the appropiate #lang instruction for bsl, in case I want to
determine language from source? Is there one? Thanks.




Posted on the users mailing list.