From 0442df42873e9ef8d39493f6106922d8d2e16f4e Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Mon, 3 Jun 2019 10:24:10 +0200 Subject: [PATCH 1/3] Reverting getBounds to bound to avoid excessive loading of tiles. --- lib/pixi/deepzoom/image.js | 9 +++------ lib/pixi/deepzoom/tile.js | 6 +++--- package.json | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/pixi/deepzoom/image.js b/lib/pixi/deepzoom/image.js index eb5389e..c03efc3 100755 --- a/lib/pixi/deepzoom/image.js +++ b/lib/pixi/deepzoom/image.js @@ -635,7 +635,7 @@ export class DeepZoomImage extends PIXI.Container { } worldBounds() { - let viewBounds = this.app.scene.getBounds() + let viewBounds = this.app.scene.bounds // UO: Never use getBounds() // Using getBounds extends visible scope after loading tiles and leads // to excessive loading if (this.world != null) { @@ -1039,7 +1039,7 @@ export class DeepZoomImage extends PIXI.Container { this.ensureTiles(this.currentLevel, event.about) return } - + let level = this.levelForScale(event.scale) let newLevel = Math.max(level, this.minimumLevel) if (newLevel != this.currentLevel) { @@ -1076,15 +1076,12 @@ export class DeepZoomImage extends PIXI.Container { */ deactivate() { this.destroyAllTiles() - Object.keys(this.tileLayers).forEach(key => { - this.destroyTiles(key) - }) this.tileContainer.destroy({ children: true }) printTileCacheInfos() } throwFinished() { - console.log("throwFinished") + //console.log("throwFinished") let key = this.currentLevel.toString() let currentTiles = this.tileLayers[key] if (typeof currentTiles == 'undefined') { diff --git a/lib/pixi/deepzoom/tile.js b/lib/pixi/deepzoom/tile.js index 79c8134..edde0fa 100644 --- a/lib/pixi/deepzoom/tile.js +++ b/lib/pixi/deepzoom/tile.js @@ -143,14 +143,14 @@ export default class Tile extends PIXI.Sprite { let count = this.unregister() if (keepTextures > 0) { - keptTextures.push({ url: this.url, texture: this.texture}) + keptTextures.push({ url: this.url, texture: this.texture }) let opts = { children: true, texture: false, baseTexture: false } if (debug) console.log("Tile.destroy", registeredTiles.size, opts) super.destroy(opts) - while(keptTextures.length > keepTextures) { - let {url, texture} = keptTextures.shift() + while (keptTextures.length > keepTextures) { + let { url, texture } = keptTextures.shift() if (Tile.isObsolete(url)) { texture.destroy(true) // Destroy base as well if (debug) console.log("Destroying texture and baseTexture", url) diff --git a/package.json b/package.json index 3f8a780..b3b4492 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iwmlib", - "version": "1.0.10", + "version": "1.0.11", "description": "An Open Source library for multi-touch, WebGL powered applications.", "main": "index.js", "directories": { From 95d1941545a02a2820ad48ab38b14c5c09f93b71 Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Mon, 3 Jun 2019 10:49:56 +0200 Subject: [PATCH 2/3] Disabled debug flag. --- lib/pixi/deepzoom/tile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pixi/deepzoom/tile.js b/lib/pixi/deepzoom/tile.js index edde0fa..3ac08ff 100644 --- a/lib/pixi/deepzoom/tile.js +++ b/lib/pixi/deepzoom/tile.js @@ -139,7 +139,7 @@ export default class Tile extends PIXI.Sprite { * @param {*} options Part of the PIXI API, but ignored in the implementation * @memberof Tile */ - destroy(options, debug = true) { + destroy(options, debug = false) { let count = this.unregister() if (keepTextures > 0) { From b208592e3a433a3d078ecc274198a799eeadffe1 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Mon, 3 Jun 2019 10:53:33 +0200 Subject: [PATCH 3/3] Version 1.0.12. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 11d88ce..d95dc43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iwmlib", - "version": "1.0.11", + "version": "1.0.12", "description": "An Open Source library for multi-touch, WebGL powered applications.", "main": "index.js", "directories": {