diff --git a/cocos/gfx/webgl/webgl-device.ts b/cocos/gfx/webgl/webgl-device.ts index ae5a1230c4..262cbde641 100644 --- a/cocos/gfx/webgl/webgl-device.ts +++ b/cocos/gfx/webgl/webgl-device.ts @@ -254,9 +254,11 @@ export class WebGLGFXDevice extends GFXDevice { }; this._webGLRC = this._canvas.getContext('webgl', webGLCtxAttribs); + /* if (this._webGLRC && info.debug) { this._webGLRC = WebGLDeveloperTools.makeDebugContext(this._webGLRC, this._onWebGLError.bind(this)); } + */ } catch (err) { console.error(err); return false; diff --git a/cocos/renderer/ui/ui.ts b/cocos/renderer/ui/ui.ts index 0d64621502..8af839ef2e 100644 --- a/cocos/renderer/ui/ui.ts +++ b/cocos/renderer/ui/ui.ts @@ -279,8 +279,8 @@ export class UI { if (curCamera) { cmdBuff.endRenderPass(); } - this._renderArea.width = camera.width; - this._renderArea.height = camera.height; + this._renderArea.width = camera.orthoHeight * camera.aspect; + this._renderArea.height = camera.orthoHeight; camera.update(); @@ -292,7 +292,7 @@ export class UI { curCamera = camera; - cmdBuff.beginRenderPass(framebuffer, this._renderArea, [camera.clearColor], camera.clearDepth, camera.clearStencil); + cmdBuff.beginRenderPass(framebuffer, this._renderArea, [], camera.clearDepth, camera.clearStencil); } material.bindingLayout.bindBuffer(0, this._uiUBO!);