Problem with mask
Joe Lewis Wilkins
pepetoo at cox.net
Tue Oct 21 16:33:27 EDT 2008
Hi James,
In one of this threads first responses, I implied as much when I said
that you probably needed to subtract one from all right and bottom
coordinates, since this has been a problem for a very long time. Of
course, I don't know if just a minus one would have cured everything,
but it may have helped.
Joe Wilkins
On Oct 21, 2008, at 1:23 PM, James Hurley wrote:
> 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