瀏覽代碼

Added multires extension parameter and fixed multires zoom bug.

pull/8/head
Matthew Petroff 11 年之前
父節點
當前提交
cb429ffe72
共有 2 個檔案被更改,包括 3 行新增2 行删除
  1. +1
    -0
      examples/example-multires.json
  2. +2
    -2
      src/js/libpannellum.js

+ 1
- 0
examples/example-multires.json 查看文件

@@ -11,6 +11,7 @@
"multiRes": {
"path": "../examples/multires/",
"extension": "png",
"tileResolution": 256,
"maxSubdivisions": 8
}


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

@@ -479,7 +479,7 @@ function Renderer(canvas, image, imageType) {
for ( var j = 0; j < program.subdivisions; j++ ) {
var index = s*program.subdivisions*program.subdivisions + i*program.subdivisions + j;
program.tileNameArray[program.subdivisions][index] = this.image.path + program.subdivisions + "/" + sides[s] + i + j + ".png";
program.tileNameArray[program.subdivisions][index] = this.image.path + program.subdivisions + "/" + sides[s] + i + j + "." + this.image.extension;
}
}
}
@@ -518,7 +518,7 @@ function Renderer(canvas, image, imageType) {
// Find optimal subdivisions
var newSubdiv = 1;
while ( this.canvas.width > (newSubdiv * this.image.tileResolution) / f && newSubdiv <= this.image.maxSubdivisions ) {
while ( this.canvas.width > (newSubdiv * this.image.tileResolution) / f && newSubdiv < this.image.maxSubdivisions ) {
newSubdiv++;
}


Loading…
取消
儲存