In the current implementation of the directive, if you move the cursor out of canvas with mouse down it does not register any mouseup event that follows.
This causes the mouse to keep drawing on the canvas with the mouse up.
These commits add events to watch for entering and leaving the canvas, check if the mouse button is down and call the appropriate function if applicable. The anonymous function on PAINT_START has been refactored to a named function to make this work.
In the current implementation of the directive, if you move the cursor out of canvas with mouse down it does not register any mouseup event that follows.
This causes the mouse to keep drawing on the canvas with the mouse up.
These commits add events to watch for entering and leaving the canvas, check if the mouse button is down and call the appropriate function if applicable. The anonymous function on PAINT_START has been refactored to a named function to make this work.