Browse Source

Fix build regression introduced in 0c92d85b11 (fixes #587).

pull/573/head
Matthew Petroff 6 years ago
parent
commit
9f33510020
1 changed files with 11 additions and 8 deletions
  1. +11
    -8
      src/js/libpannellum.js

+ 11
- 8
src/js/libpannellum.js View File

@@ -115,15 +115,18 @@ function Renderer(container) {
}
}
function fillMissingFaces(imgSize) {
if (faceMissing) { // fill any missing fallback/cubemap faces with background
var nbytes = imgSize * imgSize * 4; /* RGB, plus non-functional alpha */
if (faceMissing) { // Fill any missing fallback/cubemap faces with background
var nbytes = imgSize * imgSize * 4; // RGB, plus non-functional alpha
var imageArray = new Uint8ClampedArray(nbytes);
var [r,g,b] = params.backgroundColor ? params.backgroundColor : [0, 0, 0];
r *= 255; g *= 255; b *= 255;
var i;
// maybe filling could be done faster, see e.g. https://stackoverflow.com/questions/1295584/most-efficient-way-to-create-a-zero-filled-javascript-array
for (i = 0; i < nbytes; i++) {
imageArray[i++] = r; imageArray[i++] = g; imageArray[i++] = b;
var rgb = params.backgroundColor ? params.backgroundColor : [0, 0, 0];
rgb[0] *= 255;
rgb[1] *= 255;
rgb[2] *= 255;
// Maybe filling could be done faster, see e.g. https://stackoverflow.com/questions/1295584/most-efficient-way-to-create-a-zero-filled-javascript-array
for (var i = 0; i < nbytes; i++) {
imageArray[i++] = rgb[0];
imageArray[i++] = rgb[1];
imageArray[i++] = rgb[2];
}
var backgroundSquare = new ImageData(imageArray, imgSize, imgSize);
for (s = 0; s < 6; s++) {


Loading…
Cancel
Save