mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Merge pull request #2195 from knoxHuang/fix_bug
fix ArmatureDisplay addEventListener invalid for fireball/issues/6718
This commit is contained in:
@@ -398,9 +398,10 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
var self = this;
|
||||
|
||||
// discard exists sgNode
|
||||
var listenersBefore = null;
|
||||
var listenersBefore = null, listenersCacheBefore = null;
|
||||
if (self._sgNode) {
|
||||
listenersBefore = self._sgNode._bubblingListeners; // get the listeners added before
|
||||
listenersCacheBefore = self._sgNode._hasListenerCache;
|
||||
if (self.node._sizeProvider === self._sgNode) {
|
||||
self.node._sizeProvider = null;
|
||||
}
|
||||
@@ -420,6 +421,7 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
|
||||
if (listenersBefore) {
|
||||
sgNode._bubblingListeners = listenersBefore; // using the listeners added before
|
||||
sgNode._hasListenerCache = listenersCacheBefore;
|
||||
if (CC_JSB && !sgNode.hasEventCallback()) {
|
||||
// In JSB, should set event callback of the new sgNode
|
||||
// to make the listeners work well.
|
||||
|
||||
Reference in New Issue
Block a user