[racket] overlay and overlay/xy

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Mon Jan 31 07:07:10 EST 2011

I've been bothered by overlay/xy for a long time, and as Don says, I  
often find it easier to just plug in numbers and nudge them until  
they're right than to figure them out from first principles (let's  
see... it lines up the center of this image with the top-left of that  
one?  Or the other way around?  And which one is going on top?  And  
which one is being offset?)  If _I_ would rather use trial and error  
than first principles, my students will lean even more in that  

I find place-image more intuitive and easier to use.  Perhaps this is  
because the typical use of place-image is to place a small picture  
within a large, unchanging "background", so using the center of the  
former and the top-left of the latter makes sense.  The typical use  
of overlay/xy is different -- two images of comparable sizes, not  
cropping either one to the other -- so simply porting the same  
convention to overlay/xy might not work.

Backwards compatibility is an issue -- although perhaps not a big  
one, since overlay/xy is a pain to use so there may not be all that  
many uses of it.  (It's mentioned in my textbook, but not used very  
much.)  If overlay/xy is "fixed", I would suggest giving it a new  
name like "overlay/offset".

Stephen Bloch
sbloch at adelphi.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110131/eeab71a3/attachment.html>

Posted on the users mailing list.