浏览代码

Fix regression with CSS fallback renderer.

Regression caused rendering issue for cubemaps (but not multires) when CSS
fallback render was used. The regression was introduced as an optimization in
5eab5366f6.
pull/1055/head
Matthew Petroff 3 年前
父节点
当前提交
0967632240
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      src/js/libpannellum.js

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

@@ -45,6 +45,7 @@ function Renderer(container) {
var texCoordBuffer, cubeVertBuf, cubeVertTexCoordBuf, cubeVertIndBuf;
var globalParams;
var sides = ['f', 'b', 'u', 'd', 'l', 'r'];
var fallbackSides = ['f', 'r', 'b', 'l', 'u', 'd'];

/**
* Initialize renderer.
@@ -205,7 +206,7 @@ function Renderer(container) {
var onLoad = function() {
// Draw image on canvas
var faceCanvas = document.createElement('canvas');
faceCanvas.className = 'pnlm-face pnlm-' + sides[this.side] + 'face';
faceCanvas.className = 'pnlm-face pnlm-' + fallbackSides[this.side] + 'face';
world.appendChild(faceCanvas);
var faceContext = faceCanvas.getContext('2d');
faceCanvas.style.width = this.width + 4 + 'px';
@@ -284,7 +285,7 @@ function Renderer(container) {
faceImg.onload = onLoad;
faceImg.onerror = incLoaded; // ignore missing face to support partial fallback image
if (imageType == 'multires') {
faceImg.src = path.replace('%s', sides[s]) + '.' + image.extension;
faceImg.src = path.replace('%s', fallbackSides[s]) + '.' + image.extension;
} else {
faceImg.src = image[s].src;
}


正在加载...
取消
保存