bencentra / jq-signature

jQuery plugin for creating touch-friendly signature fields using the HTML5 canvas
http://bencentra.github.io/jq-signature/
MIT License
47 stars 28 forks source link

clearCanvas don't work in IE11 #4

Closed xhxno36 closed 9 years ago

xhxno36 commented 9 years ago

clearCanvas function don't work in IE11.when i just draw a line,then click clear button,then draw a line again,the last line just show up

bencentra commented 9 years ago

Yeah, if you look at #2 I've been meaning to test across all browsers. I'm guessing if IE11 is broken, then IE 9 and 10 are as well.

I can take a look when I get a chance, but if you figure it out first feel free to submit a PR!

bencentra commented 9 years ago

Fixed: https://github.com/bencentra/jq-signature/commit/9f77820c189b7d32c841bfaa90afca014f4e0fe0

I was using the canvas.width = canvas.width hack to clear the canvas, which worked in all other browsers. The canvas is now cleared properly using context.clearRect(), and paths are created properly with context.beginPath().