Hi all,

I got 2 lines drawn using drawView. The first line has
a red background and the second line has a green background.
The first line is drawn within the red background and the
second line is drawn outside the green background.
Because of this, the event handling for the second line only
happens if I clicked within the green box, nothing happened
if I clicked on the actual second line.

Why is the second line not inside the green box??
Am I missing something or is this a bug??

Here is the code

<canvas debug="true">
    <simplelayout axis="y" spacing="5"/>
    <view>
      <simplelayout axis="x"/>
      <drawview name="drawview1" x="0" y="0" width="100" height="100"
        bgcolor="red" clip="true">
        <method event="oninit">
            this.beginPath();
            this.moveTo(this.x, this.y);
            this.lineTo(this.x + 100, this.y + 100);
            this.stroke();
        </method>
        <method event="onclick">
            this.setAttribute('lineWidth', 3);
            this.stroke();
            canvas.display.setText("line clicked");
            Debug.write("line clicked");
        </method>
      </drawview>

      <drawview name="drawview2" x="0" y="0" width="100" height="100"
        bgcolor="green" >
        <method event="oninit">
            this.beginPath();
            this.moveTo(this.x, this.y);
            this.lineTo(this.x + 100, this.y + 100);
            this.stroke();
        </method>
        <method event="onclick">
            this.setAttribute('lineWidth', 3);
            this.stroke();
            canvas.display.setText("line2 clicked");
            Debug.write("line2 clicked");
        </method>
      </drawview>
    </view>

    <text name="display"/>
</canvas>

Cheers,
Virginia
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to