Merge pull request #2082 from feijing566/master

[dragonbones]miss clone _hasListenerCache
This commit is contained in:
Jare Guo
2017-10-30 11:26:31 +08:00
committed by GitHub
+3 -1
View File
@@ -381,9 +381,10 @@ dragonBones.ArmatureDisplay = cc.Class({
var self = this;
// discard exists sgNode
var listenersBefore = null;
var listenersBefore = null, listenerCacheBefore = null;
if (self._sgNode) {
listenersBefore = self._sgNode._bubblingListeners; // get the listeners added before
listenerCacheBefore = self._sgNode._hasListenerCache;
if ( self.node._sizeProvider === self._sgNode ) {
self.node._sizeProvider = null;
}
@@ -403,6 +404,7 @@ dragonBones.ArmatureDisplay = cc.Class({
if (listenersBefore) {
sgNode._bubblingListeners = listenersBefore; // using the listeners added before
sgNode._hasListenerCache = listenerCacheBefore;
if (CC_JSB && !sgNode.hasEventCallback()) {
// In JSB, should set event callback of the new sgNode
// to make the listeners work well.