I’m having an issue drawing to a canvas, I’m sure i’m missing something obvious but i can’t see where.
There is a loop running which should be giving me a pencil sketch effect, in fact it’s even outputting all of the lines correctly to the console and the timers are working fine, but it’s not actually drawing anything to the canvas.
I’m sure I’m going mad…. I’ve done this before a hundred times:
Any help would be much appreciated.
Alex
http://jsfiddle.net/jabMT/4/
here is fixed version – nice effect! 🙂
your problem was that you were passing array as argument to the moveTo and to the bezierCurveTo where it accepts all values as separate arguments – to be able to pass just an array you can use the
applymethod and pass canvas context as method context.Also moved setting the canvas properties to the newStroke method as it didnt make sense to set them on each new point i think?