pwambach / angular-canvas-painter

Angular.js directive to paint on a canvas on desktop or touch devices
MIT License
116 stars 35 forks source link

canvas mouse leave behaviour #14

Closed stevenlundy closed 9 years ago

stevenlundy commented 9 years ago

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.

pwambach commented 9 years ago

Hey, cool thanks, sounds good. I will check and merge it tomorrow.