[racket] Bug in place-image?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Dec 20 17:23:35 EST 2012

On Dec 19, 2012, at 3:47 PM, Miguel Villaverde wrote:

> 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?


This is not a bug but an unfortunate feature. 
The documentation for 2htdp/image has a section 
on the details of drawing things with pen (bottom). 


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

#lang bsl does not work properly yet. 

-- Matthias


Posted on the users mailing list.