mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Fixed a bug about canvas clipping node
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user