[Laszlo-dev] Bug report

Frisco Del Rosario frisco at laszlosystems.com
Tue Jan 24 17:31:12 PST 2006


On Jan 24, 2006, at 6:20 AM, Paco Hernández wrote:

> containsPt method doesn't work as expected.
>
> In the following example, the point (50, 50) is not included in the  
> myView view. It should return "false" when clicking the button, but  
> it returns "true".
>
> <canvas debug="true">
>     <view name="myView" x="100" y="100" width="100" height="100"  
> bgcolor="red"/>
>     <button>
>         Click me
>         <method event="onclick"><![CDATA[
>             Debug.write(myView.containsPt(50, 50));
>         ]]>
>         </method>
>     </button>
> </canvas>

In that example, containsPt refers to a point within the canvas,  
where 50,50 is always true. This one compares the point within the  
red view to the canvas:

<canvas debug="true">
     <view name="myView" x="250" y="250" width="250" height="250"  
bgcolor="red"/>
     <button>
         Click me
         <method event="onclick"><![CDATA[
             Debug.write(myView.containsPt(50 - myView.x, 50 -  
myView.y));
         ]]>
         </method>
     </button>
</canvas>


More information about the Laszlo-dev mailing list