Problem with mask

James Hurley jhurley0305 at sbcglobal.net
Tue Oct 21 16:23:45 EDT 2008


Well, my problem with mask is no more.

Turns out the Run Rev within() function is a bit strange.

The masked ellipse is flat on the right side and the bottom because  
within() counts the left and top  of a graphic to within the graphic,  
but not the right and bottom.

You can see this in the stack:

go url "http://home.infostations.net/jhurley/WithinTest.rev"

(I suspect that I was responsible for the url failing in a previous  
message. I crashed my computer, and in the re-install my mail program  
got converted to RTF.)

A really simple test to see this behavior is the following:

on mouseUp
   create grc "square"
   set the type  of grc "square" to rectangle
   set the rect of grc "square" to 1,1,100,100
   set the loc of grc "square" to 50,50
   set the opaque of grc "square" to true
   put 1,1 into p1
   put 1,100 into p2
   put within(grc "square", p1) & cr & within(grc "square", p2) into  
msg box
   --I get True and false.
end mouseUpp

The left edge is within the square and so is the top, but not the  
right edge or the bottom.

I don't know if this qualifies as a bug. Maybe there is a good reason  
for this behavior. But it is strange.

Jim Hurley



More information about the use-livecode mailing list