[Laszlo-user] Troubles with erasing previous elements on a, drawview

André Bargull a.bargull at intensis.de
Fri Jan 11 12:44:18 PST 2008


Hello shishir,

the "clear"-method resets only the viewing area, to begin a new path, 
you need to invoke "drawview#beginPath()".

- André

> Hi,
> I am trying to use the drawview and incorporate a user edit.
> The way I'd like to do it clear the previous elements and then redraw.
>
> However as this simple script illustrates, a clear and redraw lands up
> redrawing the old and new.
> Would appreciate any pointers to what I am missing here.
>
> I'm using the 4.0.7 SDK + Vista + swf7 + Firefox.
>
> Any help is appreciated.
> -shishir
>
> <canvas>
>   <drawview width="400" height="400">
>     <handler name="oncontext">
>       this.strokeStyle = 0x000000;
>       this.rect(10,10,30,30);
>       this.stroke();
>       this.clear();
>       this.rect(30,30,60,60);
>       this.stroke();
>     </handler>
>   </drawview>
> </canvas>



More information about the Laszlo-user mailing list