From 7e9c1a35393c67e24d224b8625924402133efec7 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Mon, 1 Apr 2019 20:26:27 +0800 Subject: [PATCH] Fix View.setCanvasSize (#4123) --- cocos/core/platform/CCView.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cocos/core/platform/CCView.js b/cocos/core/platform/CCView.js index d85e374de1..96756f92b9 100644 --- a/cocos/core/platform/CCView.js +++ b/cocos/core/platform/CCView.js @@ -552,11 +552,8 @@ class View extends EventTarget { var canvas = cc.game.canvas; var container = cc.game.container; - //canvas.width = width * this._devicePixelRatio; - //canvas.height = height * this._devicePixelRatio; - - const w = width * this._devicePixelRatio; - const h = height * this._devicePixelRatio; + canvas.width = width * this._devicePixelRatio; + canvas.height = height * this._devicePixelRatio; canvas.style.width = width + 'px'; canvas.style.height = height + 'px';