regenerated pngs
9
dist/iwmlib.js
vendored
@ -2336,8 +2336,6 @@
|
|||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
if (this.capture(event) && this.target.onMouseWheel) {
|
if (this.capture(event) && this.target.onMouseWheel) {
|
||||||
this.target.onMouseWheel(event);
|
this.target.onMouseWheel(event);
|
||||||
} else {
|
|
||||||
//console.warn('Target has no onMouseWheel callback')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2531,8 +2529,6 @@
|
|||||||
}
|
}
|
||||||
if (this.target.onMouseWheel) {
|
if (this.target.onMouseWheel) {
|
||||||
this.target.onMouseWheel(event);
|
this.target.onMouseWheel(event);
|
||||||
} else {
|
|
||||||
//console.warn('Target has no onMouseWheel callback', this.target)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4206,10 +4202,7 @@
|
|||||||
let event = new ResizeEvent(this, { width: w, height: h });
|
let event = new ResizeEvent(this, { width: w, height: h });
|
||||||
this.onResize(event);
|
this.onResize(event);
|
||||||
}
|
}
|
||||||
if (this.resizeButton != null) {
|
if (this.resizeButton != null) ;
|
||||||
// this.resizeButton.style.width = 50/this.scale+"px"
|
|
||||||
// this.resizeButton.style.height = 50/this.scale+"px"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startResize(e) {
|
startResize(e) {
|
||||||
|
60
dist/iwmlib.pixi.js
vendored
@ -5500,8 +5500,6 @@
|
|||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
if (this.capture(event) && this.target.onMouseWheel) {
|
if (this.capture(event) && this.target.onMouseWheel) {
|
||||||
this.target.onMouseWheel(event);
|
this.target.onMouseWheel(event);
|
||||||
} else {
|
|
||||||
//console.warn('Target has no onMouseWheel callback')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5695,8 +5693,6 @@
|
|||||||
}
|
}
|
||||||
if (this.target.onMouseWheel) {
|
if (this.target.onMouseWheel) {
|
||||||
this.target.onMouseWheel(event);
|
this.target.onMouseWheel(event);
|
||||||
} else {
|
|
||||||
//console.warn('Target has no onMouseWheel callback', this.target)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7208,10 +7204,7 @@
|
|||||||
let event = new ResizeEvent(this, { width: w, height: h });
|
let event = new ResizeEvent(this, { width: w, height: h });
|
||||||
this.onResize(event);
|
this.onResize(event);
|
||||||
}
|
}
|
||||||
if (this.resizeButton != null) {
|
if (this.resizeButton != null) ;
|
||||||
// this.resizeButton.style.width = 50/this.scale+"px"
|
|
||||||
// this.resizeButton.style.height = 50/this.scale+"px"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startResize(e) {
|
startResize(e) {
|
||||||
@ -7806,8 +7799,8 @@
|
|||||||
const registeredTiles = new Map();
|
const registeredTiles = new Map();
|
||||||
const pendingTiles = new Map();
|
const pendingTiles = new Map();
|
||||||
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
||||||
const keepBaseTextures = 0;
|
let keepTextures = 0;
|
||||||
const keptBaseTextures = [];
|
const keptTextures = [];
|
||||||
|
|
||||||
/** The current Tile implementation simply uses PIXI.Sprites.
|
/** The current Tile implementation simply uses PIXI.Sprites.
|
||||||
*
|
*
|
||||||
@ -7828,8 +7821,8 @@
|
|||||||
* @param {*} value
|
* @param {*} value
|
||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
static enableKeepBaseTextures(value = 1000) {
|
static enableKeepTextures(value = 1000) {
|
||||||
keepBaseTextures = value;
|
keepTextures = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7852,13 +7845,21 @@
|
|||||||
* Returns true iff the url is pending
|
* Returns true iff the url is pending
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
* @param {*} url
|
||||||
* @returns
|
* @returns
|
||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
static isPending() {
|
static isPending(url) {
|
||||||
return pendingTiles.has(url) && pendingTiles.get(url) > 0
|
return pendingTiles.has(url) && pendingTiles.get(url) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isObsolete(url) {
|
||||||
|
if (registeredTiles.has(url) && registeredTiles.get(url) > 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the given url from pending urls.
|
* Removes the given url from pending urls.
|
||||||
*
|
*
|
||||||
@ -7924,6 +7925,7 @@
|
|||||||
tiles.delete(this);
|
tiles.delete(this);
|
||||||
if (tiles.size == 0) {
|
if (tiles.size == 0) {
|
||||||
registeredTiles.delete(this.url);
|
registeredTiles.delete(this.url);
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return tiles.size
|
return tiles.size
|
||||||
}
|
}
|
||||||
@ -7937,25 +7939,24 @@
|
|||||||
destroy(options, debug = true) {
|
destroy(options, debug = true) {
|
||||||
let count = this.unregister();
|
let count = this.unregister();
|
||||||
|
|
||||||
if (keepBaseTextures > 0) {
|
if (keepTextures > 0) {
|
||||||
keptBaseTextures.push({ url: this.url, texture: this.texture.baseTexture});
|
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(keptBaseTextures.length > keepBaseTextures) {
|
while(keptTextures.length > keepTextures) {
|
||||||
let {url, texture} = keptBaseTextures.shift();
|
let {url, texture} = keptTextures.shift();
|
||||||
let tiles = registeredTiles.get(url);
|
if (Tile.isObsolete(url)) {
|
||||||
if (tiles.size > 0 && !Tile.isPending(url)) {
|
texture.destroy(true); // Destroy base as well
|
||||||
texture.destroy();
|
if (debug) console.log("Destroying texture and baseTexture", url);
|
||||||
if (debug) console.log("Destroying baseTexture", url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// No longer registered and not pending
|
// No longer registered and not pending
|
||||||
if (count <= 0 && !Tile.isPending(url)) {
|
if (count <= 0 && !Tile.isPending(this.url)) {
|
||||||
let opts = { children: true, texture: true, baseTexture: true };
|
let opts = { children: true, texture: true, baseTexture: true };
|
||||||
super.destroy(opts);
|
super.destroy(opts);
|
||||||
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
@ -7971,7 +7972,6 @@
|
|||||||
this.visible = false;
|
this.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7992,6 +7992,16 @@
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Texture received too late. We do not need it.
|
||||||
|
* @param {*} url
|
||||||
|
* @param {*} texture
|
||||||
|
*/
|
||||||
|
static lateTexture(url, texture) {
|
||||||
|
let destroyBase = !registeredTiles.has(url);
|
||||||
|
texture.destroy(destroyBase);
|
||||||
|
}
|
||||||
|
|
||||||
static printInfos() {
|
static printInfos() {
|
||||||
let references = new Map();
|
let references = new Map();
|
||||||
let multiples = 0;
|
let multiples = 0;
|
||||||
@ -8166,8 +8176,8 @@
|
|||||||
_onLoaded(loader, resource) {
|
_onLoaded(loader, resource) {
|
||||||
if (this.destroyed) {
|
if (this.destroyed) {
|
||||||
let texture = resource.texture;
|
let texture = resource.texture;
|
||||||
let destroyBase = !deepZoomTileCache.has(resource.url);
|
let url = resource.url;
|
||||||
texture.destroy(destroyBase);
|
Tile.lateTexture(url, texture);
|
||||||
console.warn("Received resource after destroy", texture);
|
console.warn("Received resource after destroy", texture);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |