optimize dragonbones

This commit is contained in:
yinkaile
2018-01-03 18:55:14 +08:00
parent 977752f4ff
commit 2a998fde3c
2 changed files with 12 additions and 7 deletions
+5 -2
View File
@@ -130,9 +130,12 @@ dragonBones.CCFactory = cc.Class({
let slot = BaseObject.borrowObject(dragonBones.CCSlot);
let displayList = [];
slot.name = slotData.name;
let display = new cc.Node();
display.name = slot.name = slotData.name;
// let display = new cc.Node();
// display.name = slot.name;
let display = slot;
slot.init(slotData, displays, display, display);
return slot;
+7 -5
View File
@@ -72,7 +72,7 @@ dragonBones.CCSlot = cc.Class({
}
if (this._display instanceof dragonBones.ArmatureDisplay) {
this._display.node.parent = this._rawDisplay;
this._display.node.parent = this._armature.display.node;
}
},
@@ -342,10 +342,12 @@ dragonBones.CCSlot = cc.Class({
t.m12 = this.globalTransformMatrix.tx - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY);
t.m13 = -(this.globalTransformMatrix.ty - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY));
let node = this._rawDisplay;
math.mat4.copy(node._matrix, t);
node._localMatDirty = false;
node._worldMatDirty = true;
if (this._display instanceof dragonBones.ArmatureDisplay) {
let node = this._display.node;
math.mat4.copy(node._matrix, t);
node._localMatDirty = false;
node._worldMatDirty = true;
}
this._updateVertices();
},