Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
This commit is contained in:
commit
2d1a6b1b7f
@ -635,7 +635,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
worldBounds() {
|
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
|
// Using getBounds extends visible scope after loading tiles and leads
|
||||||
// to excessive loading
|
// to excessive loading
|
||||||
if (this.world != null) {
|
if (this.world != null) {
|
||||||
@ -1039,7 +1039,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
this.ensureTiles(this.currentLevel, event.about)
|
this.ensureTiles(this.currentLevel, event.about)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let level = this.levelForScale(event.scale)
|
let level = this.levelForScale(event.scale)
|
||||||
let newLevel = Math.max(level, this.minimumLevel)
|
let newLevel = Math.max(level, this.minimumLevel)
|
||||||
if (newLevel != this.currentLevel) {
|
if (newLevel != this.currentLevel) {
|
||||||
@ -1076,15 +1076,12 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
*/
|
*/
|
||||||
deactivate() {
|
deactivate() {
|
||||||
this.destroyAllTiles()
|
this.destroyAllTiles()
|
||||||
Object.keys(this.tileLayers).forEach(key => {
|
|
||||||
this.destroyTiles(key)
|
|
||||||
})
|
|
||||||
this.tileContainer.destroy({ children: true })
|
this.tileContainer.destroy({ children: true })
|
||||||
printTileCacheInfos()
|
printTileCacheInfos()
|
||||||
}
|
}
|
||||||
|
|
||||||
throwFinished() {
|
throwFinished() {
|
||||||
console.log("throwFinished")
|
//console.log("throwFinished")
|
||||||
let key = this.currentLevel.toString()
|
let key = this.currentLevel.toString()
|
||||||
let currentTiles = this.tileLayers[key]
|
let currentTiles = this.tileLayers[key]
|
||||||
if (typeof currentTiles == 'undefined') {
|
if (typeof currentTiles == 'undefined') {
|
||||||
|
@ -139,18 +139,18 @@ export default class Tile extends PIXI.Sprite {
|
|||||||
* @param {*} options Part of the PIXI API, but ignored in the implementation
|
* @param {*} options Part of the PIXI API, but ignored in the implementation
|
||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
destroy(options, debug = true) {
|
destroy(options, debug = false) {
|
||||||
let count = this.unregister()
|
let count = this.unregister()
|
||||||
|
|
||||||
if (keepTextures > 0) {
|
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 }
|
let opts = { children: true, texture: false, baseTexture: false }
|
||||||
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
super.destroy(opts)
|
super.destroy(opts)
|
||||||
|
|
||||||
while(keptTextures.length > keepTextures) {
|
while (keptTextures.length > keepTextures) {
|
||||||
let {url, texture} = keptTextures.shift()
|
let { url, texture } = keptTextures.shift()
|
||||||
if (Tile.isObsolete(url)) {
|
if (Tile.isObsolete(url)) {
|
||||||
texture.destroy(true) // Destroy base as well
|
texture.destroy(true) // Destroy base as well
|
||||||
if (debug) console.log("Destroying texture and baseTexture", url)
|
if (debug) console.log("Destroying texture and baseTexture", url)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "iwmlib",
|
"name": "iwmlib",
|
||||||
"version": "1.0.10",
|
"version": "1.0.12",
|
||||||
"description": "An Open Source library for multi-touch, WebGL powered applications.",
|
"description": "An Open Source library for multi-touch, WebGL powered applications.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
Loading…
Reference in New Issue
Block a user