T
Tyrone Slothrop
I have created a copy of this example:
http://devfiles.myopera.com/articles/649/example2.html
to which I have added a function which will generate the coordinates
of the drawing to a hidden field.
The client would like the continuation of the drawing of the line
should mouseout and mousedown are both true, that is if someone is
drawing and strays off the canvas and returns. In the example URL,
you can see (at least in FF) is you leave and return to canvas, a line
is created between the point of mouseout and mouseover when mousedown
is true. Since the purpose of the canvas script is to create a
signature, this is undesireable.
To fix the mouseout problem, I added a listener which terminates the
line onmouseout. However, I am at a loss as to how to restart the
drawing when pointer returns to the canvas. Since only one event can
be defined by addEventListener, it is not possible to listen for both
mouseover and mousedown.
Perhaps I am approaching this the wrong way. The intent is to remove
the connecting line when the pointer returns to the canvas. What
really is needed is a way to terminate and restart without having to
add another listener.
Anyone have an suggestions?
TIA
http://devfiles.myopera.com/articles/649/example2.html
to which I have added a function which will generate the coordinates
of the drawing to a hidden field.
The client would like the continuation of the drawing of the line
should mouseout and mousedown are both true, that is if someone is
drawing and strays off the canvas and returns. In the example URL,
you can see (at least in FF) is you leave and return to canvas, a line
is created between the point of mouseout and mouseover when mousedown
is true. Since the purpose of the canvas script is to create a
signature, this is undesireable.
To fix the mouseout problem, I added a listener which terminates the
line onmouseout. However, I am at a loss as to how to restart the
drawing when pointer returns to the canvas. Since only one event can
be defined by addEventListener, it is not possible to listen for both
mouseover and mousedown.
Perhaps I am approaching this the wrong way. The intent is to remove
the connecting line when the pointer returns to the canvas. What
really is needed is a way to terminate and restart without having to
add another listener.
Anyone have an suggestions?
TIA