I am trying to draw a rectangle polyline over a canvas containing a color image, then (via way of a mouse drag move event) remove that rectangle polyline with it's original points and redraw as a new rectangle polyline using the new x,y co-ordinates. Code below paints with or without "xor", my problem is it will not erase when using the same points, happy for any help - Thanks - Andy
UniSession.AddJS('var context=fMain.cArea._cc_; '+
'var polyln = ['+s+']; '+
'var shape = polyln.slice(0); '+
'{ '+
' context.globalAlpha = 1; '+
' context.globalCompositeOperation = ''xor''; '+
' context.lineWidth = 1; '+
' context.strokeStyle = "'+LineColourStr+'"; '+
' context.moveTo(shape.shift(), shape.shift()); '+
' while(shape.length) '+
' { '+
' context.lineTo(shape.shift(), shape.shift()); '+
' } '+
' context.stroke(); '+
' context.globalCompositeOperation = ''source-over''; '+
' context.globalAlpha = 1; '+
'}; '
);