|
25 | 25 |
|
26 | 26 | (function(){
|
27 | 27 | ccs.Skin.RenderCmd = {
|
| 28 | + _realWorldTM: null, |
28 | 29 | transform: function (parentCmd, recursive) {
|
29 | 30 | var node = this._node,
|
30 | 31 | pt = parentCmd ? parentCmd._worldTransform : null,
|
|
69 | 70 | wt.tx = t.tx;
|
70 | 71 | wt.ty = t.ty;
|
71 | 72 | }
|
| 73 | + var rwtm = this._realWorldTM; |
| 74 | + if(rwtm) { |
| 75 | + rwtm.a = t.a; rwtm.b = t.b; rwtm.c = t.c; rwtm.d = t.d; rwtm.tx= t.tx; rwtm.ty = t.ty; |
| 76 | + cc.affineTransformConcatIn(rwtm, this._node.bone.getArmature()._renderCmd._worldTransform); |
| 77 | + } |
72 | 78 | },
|
73 | 79 |
|
74 | 80 | getNodeToWorldTransform: function () {
|
|
86 | 92 |
|
87 | 93 | ccs.Skin.CanvasRenderCmd = function(renderable){
|
88 | 94 | cc.Sprite.CanvasRenderCmd.call(this, renderable);
|
| 95 | + this._realWorldTM = {a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0}; |
89 | 96 | };
|
90 | 97 |
|
91 | 98 | var proto = ccs.Skin.CanvasRenderCmd.prototype = Object.create(cc.Sprite.CanvasRenderCmd.prototype);
|
92 | 99 | cc.inject(ccs.Skin.RenderCmd, proto);
|
| 100 | + |
93 | 101 | proto.constructor = ccs.Skin.CanvasRenderCmd;
|
94 | 102 |
|
| 103 | + proto._updateCurrentRegions = function () { |
| 104 | + var temp = this._currentRegion; |
| 105 | + this._currentRegion = this._oldRegion; |
| 106 | + this._oldRegion = temp; |
| 107 | + //hittest will call the transform, and set region flag to DirtyDouble, and the changes need to be considered for rendering |
| 108 | + if (cc.Node.CanvasRenderCmd.RegionStatus.DirtyDouble === this._regionFlag && (!this._currentRegion.isEmpty())) { |
| 109 | + this._oldRegion.union(this._currentRegion); |
| 110 | + } |
| 111 | + this._currentRegion.updateRegion(this.getLocalBB(), this._realWorldTM); |
| 112 | + }; |
| 113 | + |
95 | 114 | ccs.Skin.WebGLRenderCmd = function(renderable){
|
96 | 115 | cc.Sprite.WebGLRenderCmd.call(this, renderable);
|
97 | 116 | };
|
|
0 commit comments