From e2a11da5da79a6c0042d7dddafc965d53d3026fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20H=C3=B6llerich?= Date: Sun, 7 Jun 2020 16:50:04 +0200 Subject: [PATCH] Fix tile prioritization and image loader. --- doc/json-config-parameters.md | 4 ++-- src/js/libpannellum.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/json-config-parameters.md b/doc/json-config-parameters.md index ef9cf0b..59469c4 100644 --- a/doc/json-config-parameters.md +++ b/doc/json-config-parameters.md @@ -452,9 +452,9 @@ This specifies the maximum zoom level. #### `loader` (function) -Supply a loader function instead of an URL to load tiles. +Supply an async loader function instead of an URL to load tiles. -Input: node, HTMLImageElement. Output: Promise +Input: node, HTMLImageElement. Resolved output: HTMLCanvasElement, ImageBitmap, HTMLImageElement Node has the following properties: `x` (number), `y` (number), `level` (number), `vertices` ([[number]]) part of the full image diff --git a/src/js/libpannellum.js b/src/js/libpannellum.js index 808ca6f..c3bf59a 100644 --- a/src/js/libpannellum.js +++ b/src/js/libpannellum.js @@ -1900,6 +1900,7 @@ function Renderer(container) { releaseTextureImageLoader(this); }).catch(() => { this.callback(this.texture, false); + releaseTextureImageLoader(this); }); } else { this.image.src = src; @@ -2100,6 +2101,8 @@ function Renderer(container) { * @param {number} hfov - Horizontal field of view to check at. */ function checkMultiresNodeInView(node, yaw, pitch, roll, hfov) { + let v = node.vertices; + // Create rotation matrix var matrix = identityMatrix3(); matrix = rotateMatrix(matrix, -yaw, 'y');