a few changes
Incorporated changes from Andrew Nicols (andrew@nicols.co.uk)
As well as fixed the issue about drawing on resized canvas (thanks
Andrew!)