Merge pull request #197 from VisualSJ/master

Fixed a bug about canvas clipping node
This commit is contained in:
pandamicro
2016-01-07 20:01:09 +08:00
@@ -86,8 +86,10 @@
if (this._clipElemType) {
var locCache = cc.ClippingNode.CanvasRenderCmd._getSharedCache();
var canvas = context.canvas;
locCache.width = canvas.width;
locCache.height = canvas.height; //note: on some browser, it can't clear the canvas, e.g. baidu
if (locCache.width !== canvas.width)
locCache.width = canvas.width;
if (locCache.height !== canvas.height)
locCache.height = canvas.height; //note: on some browser, it can't clear the canvas, e.g. baidu
var locCacheCtx = locCache.getContext("2d");
locCacheCtx.drawImage(canvas, 0, 0); //save the result to shareCache canvas
} else {