meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

bug: replaceCanvas runs into an endless recursion #67

Closed kaixxx closed 11 years ago

kaixxx commented 11 years ago

I tested this with the replace and crop plugins:

this.resize({
   width: 200,
   height: 200
}).render();

or

this.crop(200, 200, 20, 20).render();

In both situations, the plugin is called over and over again, finally throwing a "too much recursion" error in firefox. I suppose this has to do with the fact that the command "this.replaceCanvas(canvas);" in the plugin code somehow manages to invoke the plugin again (maybe because it is still in the render queue?), leading to an endless recursion. I have the same problem with a nice "halftone screen" plugin that I am currently developping.

aleksandrenko commented 11 years ago

I have the same issue!!!

Did anyone find a fix?

meltingice commented 11 years ago

What version of CamanJS are you guys using? I was unable to reproduce this with the current code in the master branch.

kaixxx commented 11 years ago

I was using the "Latest Stable" from camanjs.com, which is 4.0.0 You are right, the issue is gone with the latest code from the master branch, which is great news. Thanks!

meltingice commented 11 years ago

Good to know, I'll have to push out a new version.