merri-ment/lazy-line-painter

Erase method defect

Closed this issue · 6 comments

'Init' method, count is set to 1:
'count' : 1,
'Erase' method, count is set to 0:
d.count = 0;

  • but should be 1. Consequent calls (with callbacks) of 'Paint -> Erase -> Paint' didn't work for me, changed count to 1 in 'Erase' method and it worked.

Nice catch, confirmed fix. Pull request?

Hello.
I can't find this lines in current code. Where did you fix it?
Repaint doesn't work for me too.

@decadence In the erase method, replace the following line:
$this.find('svg').empty();
with
$this.empty();
and you should be able to paint again and again. I let @camoconnell know about it.

I've pushed a change addressing the erase defect. It cancels / resets raf, empties the svg and retains the jquery data object, ready for another paint. Trial it on index.html in the repo, by clicking on the window and watching output in your console. thanks!

@decadence let me know if this has fixed your issue.

@inorganik @camoconnell
Thanks for the response! It's ok now.