Run Rev's within() function--Was: Problem with mask

James Hurley jhurley0305 at sbcglobal.net
Mon Oct 27 00:54:34 EDT 2008


>
> James Hurley wrote on Sat Oct 25, 2008:
>
>> Wilhelm,
>>
>> I think the following script, placed in the card of a new stack,
>> gives the clearest idea of what the problem is. As you mouse around
>> the graphic you can see the mouse corrdinates as well as the results
>> of the user-defined within function and Run Rev's within() function.
>>
>> You can easily see precisely how the Run Rev within() function works.
>> It definitely excludes the right and bottom edges of a square, but
>> includes the top and left edges. Whatever happens when using the
>> within() funciton to construct a mask (or for whatever purpose) has
>> to be reconciled to these basic results.
>>
>> Jim Hurley
>
>
> Jim,
>
> I see your results demonstrating the difference between the two within
> functions. The question is, *how* can we use these insights to  
> avoid the
> edges? Although I have tried all sorts of things (as using "0 to
> theight-1" instead of " 1 to theight" etc. or setting absolute  
> points in
> the mask as opposed to "put after") I have nothing to offer here apart
> from workarounds.

I suspect that Run Rev is just following the dictates of the engine.

I can't see any way to get it to recognize the right edge and the  
bottom edge.

I should think that was is happening,  behind the scenes, is that RR  
is looking at the (internal) fill data in the graphic when it  
evaluates the within() function. The opaque has to be true for the  
within() function to work. But somehow the right edge and the bottom  
edge are not recognize. I can't imagine why.

If one uses this method to get a mask, I think I would just cheat to  
get around the problem with the edges. Just use an oval graphic with  
the same width and height but without the fill and with a border line  
size of 2 maybe and use it as a frame for  the image oval. That  
should cover the edges and as an extra benefit it covers the jaggies  
around the rest of the image--a poor man's cover for the lack of  
antialiasing.

I think only Run Rev can really clear up the reason for this odd  
behavior of within().

Jim



More information about the use-livecode mailing list