Canvas

Canvas drawing coordinates are relative to the top left of the canvas. However, MOUSE coordinates are relative to the top left of the window. Therefore you must offset the drawing coordinates to match the mouse coordinates.
In this canvas there is a margin of 30px, border of 10px and padding of 20px (60px total). This means you must offset your mouse position by 70 pixels! Huh?...
Note: In firefox and many browsers, the default margin is 10 PIXELS - that is why you must add 10 to 60 to get an offset of 70. Also note that an enclosing 'div' around the canvas has no effect on the canvas offset unless it has margins, borders or padding on the TOP or LEFT.
Needs work! Draw on mouse down only, control the movement when going off screen, etc...