You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling setHidden(true) on layer does not clear event listeners on children.
Solution 1:
Calling setHidden(true) on layer should also call setHidden(true) on children objects. This would need extra value to see if call was inherited to have correct behavior on setHidden(false).
Solution 2:
Rewrite getHidden() method to scan all the parents and return true if one of them is hidden. Simpler but has performance penalty.
I disagree, with both the idea that event listeners should be cleared and that getHidden() should return true because a layer or parent node is hidden. The child nodes of a hidden node should not appear on screen, but they should retain their own local "hidden" property.
Re. event listeners, I don't think they should be cleared, but I do think hitTest() should always return false for nodes that are not visible on screen, so when a node is not visible (unless maybe if its alpha is 0 but it is not hidden), things like mouse events would not fire on them. Maybe this is your issue anyway?
There is already fix for it by @ducklord75bbb41 that will probably be merged to master.
It does the parent check before triggering the event. I would let it stay this way instead of moving it to hitTest to allow hitTest to be overridden by user if there is a need for it.
Calling setHidden(true) on layer does not clear event listeners on children.
Solution 1:
Calling setHidden(true) on layer should also call setHidden(true) on children objects. This would need extra value to see if call was inherited to have correct behavior on setHidden(false).
Solution 2:
Rewrite getHidden() method to scan all the parents and return true if one of them is hidden. Simpler but has performance penalty.
Originated from: http://groups.google.com/group/limejs/browse_thread/thread/08688d9c605f0a5a#
The text was updated successfully, but these errors were encountered: