瀏覽代碼

Revert "Use error name instead of number."

This reverts commit 8f436dbf48.
pull/132/merge
Matthew Petroff 7 年之前
父節點
當前提交
37cec62a60
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      src/js/libpannellum.js

+ 3
- 3
src/js/libpannellum.js 查看文件

@@ -116,7 +116,7 @@ function Renderer(container) {
// Enable WebGL on canvas
if (!gl)
gl = canvas.getContext('experimental-webgl', {alpha: false, depth: false});
if (gl && gl.getError() == gl.INVALID_FRAMEBUFFER_OPERATION)
if (gl.getError() == 1286)
handleWebGLError1286();
}
@@ -448,7 +448,7 @@ function Renderer(container) {
canvas.width = canvas.clientWidth * pixelRatio;
canvas.height = canvas.clientHeight * pixelRatio;
if (gl) {
if (gl.getError() == INVALID_FRAMEBUFFER_OPERATION)
if (gl.getError() == 1286)
handleWebGLError1286();
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
if (imageType != 'multires') {
@@ -1177,7 +1177,7 @@ function Renderer(container) {
* @private
*/
function handleWebGLError1286() {
console.log('Reducing canvas size due to error INVALID_FRAMEBUFFER_OPERATION!');
console.log('Reducing canvas size due to error 1286!');
canvas.width = Math.round(canvas.width / 2);
canvas.height = Math.round(canvas.height / 2);
}


Loading…
取消
儲存