Bläddra i källkod

Revert "Use error name instead of number."

This reverts commit 8f436dbf48.
pull/132/merge
Matthew Petroff 7 år sedan
förälder
incheckning
37cec62a60
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. +3
    -3
      src/js/libpannellum.js

+ 3
- 3
src/js/libpannellum.js Visa fil

@@ -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);
}


Laddar…
Avbryt
Spara