Drag and Drop a shape filled with image
I tried creating jigsaw puzzle using kineticjs. Puzzle pieces is created by using Kinetic.Shape filled with image.
When i apply dragging to the shape, memory leaks (not sure where) occur and crashes the whole browser (Only happened in Mozilla Firefox).
Works perfectly in Chrome and had some frame loss on IE and Safari.
I've tried to reduce the puzzle pieces, but the problem is the same although it can survive longer before crashes.
additional info.. i found out that not only drag and drop causes issue, but also with transition. So basically if we try to move the shapes that contains image, the movement will cause memory leaks in firefox AND iOS.
Cheers
have you tried moving the image to its own layer when dragging and dropping? This greatly improves performance. Here's an example:
http://www.html5canvastutorials.com/labs/html5-canvas-kineticjs-drag-and-drop-stress-test-with-1000-shapes/
but to your point, I'll look into the FF issue as soon as I get a chance.
Ah yes.. i tried using that and it works great in improving the drag and drop. But the firefox crashing issue is still there. If I try to drag more than one object at the same time, FF will crash (I'm currently using FF 15.0.1).
I believe it has something to do with the fill property.
Thanks.
yeah there is some bug with FF but i dont know where, because of my map
http://blackscorp.github.com/tiled2crafty/kinetic/
draw process takes 22ms on FF, on Chrome/IE/Opera/Safari 0-1 ms basicly i just copy offscreen layer into the screen wonder what is going on there
Hi @ericdrowell . Just wondering whether this issue will be patched in the next version of KineticJS?
THanks.
v4.0.5 is already looking pretty heavy, so this issue will probably be addressed with a later version (mostly because it seems to be a FF bug)
can someone check this on other browser please? http://jsperf.com/simple-draw wish to look if its a kinetic or ff problem
I can confirm FF-specific issues when using image fills. FF's memory usage absolutely explodes when rapidly redrawing layers containing multiple image fills. Too much redrawing (e.g., dragging a layer for 5+ seconds) inevitably leads to a crash.
Chrome handles the same with no problem.
Although there have been a lot of performance improvements made with drag and drop, this issue is ultimately dependent on the FF Canvas API implementation. Dragging and dropping a shape filled with a pattern actually performed pretty well for me in FF.