ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 752 forks source link

Kinetic.names, Kinetic.ids suddenly loses its children and "find" method never works (KineticJS v5.1) #953

Closed emnkoksal closed 10 years ago

emnkoksal commented 10 years ago

I have about 50 Kinetic.Image. I'm keeping them in an array. Many times I'm adding/removing (not destroying) to my layer, using in tweens and changing their name property (I never change their id's).

Sometimes, suddenly Kinetic.ids loses one of their id (or Kinetic.names loses one of their name), so that find method never work again. Then to understand this strange behaviour, I add manually again that image to the layer. And when I look to the children of the layer, there is the image.

However, since its id is lost in Kinetic.ids (and it never comes back with adding again to the layer), find method never works again for that image, because find method works based on Kinetic.ids (and Kinetic.names).

There is a problem with maintaining Kinetic.ids and Kinetic.names. I had to re-write find method, which bypasses Kinetic.ids and Kinetic.names.

emnkoksal commented 10 years ago

As I told, I had re-written find method to work-around the problem, but this created another problem, as I told here:

https://github.com/ericdrowell/KineticJS/issues/963

So, this problem continues.

Any idea?