|
75 | 75 | wrapper.save();
|
76 | 76 | wrapper.save();
|
77 | 77 | wrapper.setTransform(this._worldTransform, scaleX, scaleY);
|
| 78 | + var buffer = this._node._clippingStencil._renderCmd._buffer; |
| 79 | + |
| 80 | + for (var i = 0, bufLen = buffer.length; i < bufLen; i++) { |
| 81 | + var element = buffer[i], vertices = element.verts; |
| 82 | + var firstPoint = vertices[0]; |
| 83 | + context.beginPath(); |
| 84 | + context.moveTo(firstPoint.x, -firstPoint.y ); |
| 85 | + for (var j = 1, len = vertices.length; j < len; j++) |
| 86 | + context.lineTo(vertices[j].x , -vertices[j].y ); |
| 87 | + context.closePath(); |
| 88 | + } |
78 | 89 | };
|
79 | 90 |
|
80 | 91 | proto._onRenderClipCmd = function(ctx){
|
|
95 | 106 | };
|
96 | 107 |
|
97 | 108 | proto.__stencilDraw = function(ctx,scaleX, scaleY){ //Only for Canvas
|
98 |
| - var wrapper = ctx || cc._renderContext, locContext = wrapper.getContext(), buffer = this._buffer; |
99 |
| - |
100 |
| - for (var i = 0, bufLen = buffer.length; i < bufLen; i++) { |
101 |
| - var element = buffer[i], vertices = element.verts; |
102 |
| - var firstPoint = vertices[0]; |
103 |
| - locContext.beginPath(); |
104 |
| - locContext.moveTo(firstPoint.x, -firstPoint.y ); |
105 |
| - for (var j = 1, len = vertices.length; j < len; j++) |
106 |
| - locContext.lineTo(vertices[j].x , -vertices[j].y ); |
107 |
| - locContext.closePath(); |
108 |
| - } |
| 109 | + //do nothing, rendering in layout |
109 | 110 | };
|
110 | 111 |
|
111 | 112 | proto.stencilClippingVisit = proto.scissorClippingVisit = function (parentCmd) {
|
|
0 commit comments