Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa25d13469 | |||
| 4c08359394 | |||
| b5400c8223 | |||
| 5a336e8d40 | |||
| 2d1a6b1b7f | |||
| 636e2e439c | |||
| b208592e3a | |||
| 95d1941545 | |||
| 086dfff19e | |||
| 0442df4287 | |||
| e3d167bd7f | |||
| da5ed78558 | |||
| 0c46c4e656 | |||
| 304818dc13 | |||
| 05ecd0b048 | |||
| 895ec55a46 |
@@ -7,7 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const puppeteer = require('puppeteer');
|
const puppeteer = require('puppeteer');
|
||||||
const fs = require("fs")
|
const fs_bare = require("fs") // required for fs-extra
|
||||||
|
const fs = require("fs-extra")
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const start_dir = process.cwd()
|
const start_dir = process.cwd()
|
||||||
const start_file = path.join(start_dir,"lib","index.html")
|
const start_file = path.join(start_dir,"lib","index.html")
|
||||||
@@ -39,18 +40,24 @@ async function makeScreenshot(href){
|
|||||||
page.once("load",logPageEvent)
|
page.once("load",logPageEvent)
|
||||||
|
|
||||||
await page.goto(href)
|
await page.goto(href)
|
||||||
|
href = href.replace("file:///","")
|
||||||
const fname = path.parse(href).name
|
const fname = path.parse(href).name
|
||||||
|
let fpath
|
||||||
if (fname != "index"){
|
if (fname != "index"){
|
||||||
image_url = href.replace(fname + ".html" ,"thumbnails/" + fname + ".png")
|
image_url = href.replace(fname + ".html" ,"thumbnails/" + fname + ".png")
|
||||||
|
fpath = href.replace(fname + ".html", "thumbnails")
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
image_url = href.replace(fname + ".html" ,"thumbnail.png")
|
image_url = href.replace(fname + ".html" ,"thumbnail.png")
|
||||||
|
fpath = href.replace(fname + ".html", "")
|
||||||
}
|
}
|
||||||
image_url = image_url.replace("file:///","")
|
// image_url = image_url.replace("file:///","")
|
||||||
|
// fpath = fpath.replace("file:///","")
|
||||||
|
|
||||||
page.removeAllListeners()
|
page.removeAllListeners()
|
||||||
|
|
||||||
|
fs.ensureDir(fpath)
|
||||||
|
|
||||||
await page.screenshot({path: image_url});
|
await page.screenshot({path: image_url});
|
||||||
await browser.close();
|
await browser.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2995,11 +2995,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now();
|
let t = performance.now();
|
||||||
let dt = t - this.lastframe;
|
let dt = t - this.lastframe;
|
||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime();
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity);
|
let next = this.nextVelocity(this.velocity);
|
||||||
let prevLength = Points.length(this.velocity);
|
let prevLength = Points.length(this.velocity);
|
||||||
@@ -4253,7 +4258,7 @@
|
|||||||
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
||||||
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
||||||
|
|
||||||
if (this.element.offsetWidth + resizeW / this.scale > this.width * 0.3 && this.element.offsetHeight + resizeH / this.scale > this.height * 0.3) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
if ((this.element.offsetWidth + resizeW) / this.scale > this.width * 0.5 / this.scale && (this.element.offsetHeight + resizeH) / this.scale > this.height * 0.3 / this.scale) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
||||||
|
|
||||||
this.oldX = e.clientX;
|
this.oldX = e.clientX;
|
||||||
this.oldY = e.clientY;
|
this.oldY = e.clientY;
|
||||||
|
|||||||
@@ -6159,11 +6159,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now();
|
let t = performance.now();
|
||||||
let dt = t - this.lastframe;
|
let dt = t - this.lastframe;
|
||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime();
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity);
|
let next = this.nextVelocity(this.velocity);
|
||||||
let prevLength = Points.length(this.velocity);
|
let prevLength = Points.length(this.velocity);
|
||||||
@@ -7796,8 +7801,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deepZoomTileCache = new Map();
|
/* ES Lint */
|
||||||
|
/* globals PIXI, console*/
|
||||||
|
|
||||||
|
const registeredTiles = new Map();
|
||||||
|
const pendingTiles = new Map();
|
||||||
|
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
||||||
|
let keepTextures = 0;
|
||||||
|
const keptTextures = [];
|
||||||
|
|
||||||
/** The current Tile implementation simply uses PIXI.Sprites.
|
/** The current Tile implementation simply uses PIXI.Sprites.
|
||||||
*
|
*
|
||||||
@@ -7811,6 +7822,82 @@
|
|||||||
this.register(url);
|
this.register(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static method to enable keeping of base textures
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} value
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static enableKeepTextures(value = 1000) {
|
||||||
|
keepTextures = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks the given url as pending. Pending tiles should not be destroyed
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static schedule(url) {
|
||||||
|
let count = 0;
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
count = pendingTiles.get(url);
|
||||||
|
}
|
||||||
|
pendingTiles.set(url, count + 1);
|
||||||
|
// console.log("Tile.scheduled", url, pendingTiles.size)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true iff the url is pending
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static isPending(url) {
|
||||||
|
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.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static unschedule(url) {
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
let count = pendingTiles.get(url);
|
||||||
|
if (count > 1) {
|
||||||
|
pendingTiles.set(url, count - 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pendingTiles.clear(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log("Tile.unscheduled", url, pendingTiles.size)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a tile from image using the PIXI.Texture.fromImage method.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} imageId
|
||||||
|
* @param {*} crossorigin
|
||||||
|
* @param {*} scaleMode
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
static fromImage(imageId, crossorigin, scaleMode) {
|
static fromImage(imageId, crossorigin, scaleMode) {
|
||||||
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
||||||
}
|
}
|
||||||
@@ -7823,13 +7910,14 @@
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
register(url, debug = false) {
|
register(url, debug = false) {
|
||||||
if (deepZoomTileCache.has(url)) {
|
Tile.unschedule(url);
|
||||||
let tiles = deepZoomTileCache.get(url);
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url);
|
||||||
tiles.add(this);
|
tiles.add(this);
|
||||||
if (debug) console.log("Tile.register", url, tiles.size);
|
if (debug) console.log("Tile.register", url, tiles.size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deepZoomTileCache.set(url, new Set([this]));
|
registeredTiles.set(url, new Set([this]));
|
||||||
if (debug) console.log("Tile.register", url, 1);
|
if (debug) console.log("Tile.register", url, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7841,10 +7929,11 @@
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
unregister() {
|
unregister() {
|
||||||
let tiles = deepZoomTileCache.get(this.url);
|
let tiles = registeredTiles.get(this.url);
|
||||||
tiles.delete(this);
|
tiles.delete(this);
|
||||||
if (tiles.size == 0) {
|
if (tiles.size == 0) {
|
||||||
deepZoomTileCache.delete(this.url);
|
registeredTiles.delete(this.url);
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return tiles.size
|
return tiles.size
|
||||||
}
|
}
|
||||||
@@ -7857,14 +7946,32 @@
|
|||||||
*/
|
*/
|
||||||
destroy(options, debug = false) {
|
destroy(options, debug = false) {
|
||||||
let count = this.unregister();
|
let count = this.unregister();
|
||||||
if (count <= 0) {
|
|
||||||
|
if (keepTextures > 0) {
|
||||||
|
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();
|
||||||
|
if (Tile.isObsolete(url)) {
|
||||||
|
texture.destroy(true); // Destroy base as well
|
||||||
|
if (debug) console.log("Destroying texture and baseTexture", url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// No longer registered and not pending
|
||||||
|
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", deepZoomTileCache.size, opts);
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let opts = { children: true, texture: false, baseTexture: false };
|
let opts = { children: true, texture: false, baseTexture: false };
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts);
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
super.destroy(opts);
|
super.destroy(opts);
|
||||||
}
|
}
|
||||||
if (this.parent != null) {
|
if (this.parent != null) {
|
||||||
@@ -7875,6 +7982,48 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an available texture that can be reused
|
||||||
|
*
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static textureAvailable(url) {
|
||||||
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url);
|
||||||
|
for (let tile of tiles.values()) {
|
||||||
|
//console.log("Reusing cached texture", tile.parent)
|
||||||
|
return tile.texture
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
let references = new Map();
|
||||||
|
let multiples = 0;
|
||||||
|
for (let [url, tiles] of registeredTiles.entries()) {
|
||||||
|
let count = tiles.size;
|
||||||
|
references.set(url, count);
|
||||||
|
if (count > 1) {
|
||||||
|
multiples += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log({ multiples, references });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Tile Loader component that can be plugged into a Tiles Layer.
|
* A Tile Loader component that can be plugged into a Tiles Layer.
|
||||||
*/
|
*/
|
||||||
@@ -7903,6 +8052,8 @@
|
|||||||
schedule(url, col, row) {
|
schedule(url, col, row) {
|
||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
|
Tile.schedule(url);
|
||||||
this.map.set(url, [col, row]);
|
this.map.set(url, [col, row]);
|
||||||
this.loading.add(url);
|
this.loading.add(url);
|
||||||
this.loadQueue.push(url);
|
this.loadQueue.push(url);
|
||||||
@@ -7912,6 +8063,7 @@
|
|||||||
unschedule(url) {
|
unschedule(url) {
|
||||||
if (this.loaded.has(url)) this.loaded.delete(url);
|
if (this.loaded.has(url)) this.loaded.delete(url);
|
||||||
if (this.loading.has(url)) this.loading.delete(url);
|
if (this.loading.has(url)) this.loading.delete(url);
|
||||||
|
Tile.unschedule(url);
|
||||||
this.loadQueue = this.loadQueue.filter(item => item != url);
|
this.loadQueue = this.loadQueue.filter(item => item != url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7971,16 +8123,13 @@
|
|||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
if (deepZoomTileCache.has(url)) {
|
Tile.schedule(url);
|
||||||
let tiles = deepZoomTileCache.get(url);
|
let reusableTexture = Tile.textureAvailable(url);
|
||||||
for (let tile of tiles.values()) {
|
if (reusableTexture) {
|
||||||
//console.log("Reusing cached texture", tile.parent)
|
if (this.debug) console.log('Texture reusable', reusableTexture);
|
||||||
let texture = tile.texture;
|
this._textureAvailable(url, col, row, reusableTexture);
|
||||||
this._textureAvailable(url, col, row, texture);
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let texture = PIXI.utils.TextureCache[url];
|
let texture = PIXI.utils.TextureCache[url];
|
||||||
if (texture) {
|
if (texture) {
|
||||||
if (this.debug) console.log('Texture already loaded', texture);
|
if (this.debug) console.log('Texture already loaded', texture);
|
||||||
@@ -8035,8 +8184,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
|
||||||
}
|
}
|
||||||
@@ -8497,18 +8646,8 @@
|
|||||||
return n % 2 == 0
|
return n % 2 == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function printTileCacheInfos() {
|
function printTileCacheInfos() {
|
||||||
let references = new Map();
|
Tile.printInfos();
|
||||||
let multiples = 0;
|
|
||||||
for (let [url, tiles] of deepZoomTileCache.entries()) {
|
|
||||||
let count = tiles.size;
|
|
||||||
references.set(url, count);
|
|
||||||
if (count > 1) {
|
|
||||||
multiples += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log({ multiples, references });
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* A utility class that holds information typically provided by DZI files, i.e.
|
* A utility class that holds information typically provided by DZI files, i.e.
|
||||||
@@ -8864,6 +9003,7 @@
|
|||||||
: 1;
|
: 1;
|
||||||
this.alpha = alpha;
|
this.alpha = alpha;
|
||||||
this.fastLoads = 0;
|
this.fastLoads = 0;
|
||||||
|
this.active = true;
|
||||||
this.autoLoadTiles = autoLoadTiles;
|
this.autoLoadTiles = autoLoadTiles;
|
||||||
this.minimumLevel = minimumLevel;
|
this.minimumLevel = minimumLevel;
|
||||||
this.quadTrees = new Map(); // url as keys, TileQuadNodes as values
|
this.quadTrees = new Map(); // url as keys, TileQuadNodes as values
|
||||||
@@ -8914,7 +9054,7 @@
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel;
|
this.minimumLevel = deepZoomInfo.baseLevel;
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel);
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel);
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles);
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center);
|
this.setupTiles(center);
|
||||||
}
|
}
|
||||||
@@ -9135,7 +9275,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
@@ -9517,6 +9657,9 @@
|
|||||||
* @param {boolean} debug - log debug infos
|
* @param {boolean} debug - log debug infos
|
||||||
*/
|
*/
|
||||||
transformed(event) {
|
transformed(event) {
|
||||||
|
if (!this.active) {
|
||||||
|
return
|
||||||
|
}
|
||||||
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') {
|
||||||
@@ -9564,6 +9707,7 @@
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
activate() {
|
activate() {
|
||||||
|
this.active = true;
|
||||||
this.destroyTilesAboveLevel(this.currentLevel);
|
this.destroyTilesAboveLevel(this.currentLevel);
|
||||||
this.ensureTiles(this.currentLevel, null);
|
this.ensureTiles(this.currentLevel, null);
|
||||||
//console.log("Activate Textures!", this.currentLevel)
|
//console.log("Activate Textures!", this.currentLevel)
|
||||||
@@ -9575,16 +9719,14 @@
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
this.active = false;
|
||||||
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') {
|
||||||
|
|||||||
@@ -1864,7 +1864,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel
|
this.minimumLevel = deepZoomInfo.baseLevel
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles)
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center)
|
this.setupTiles(center)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ a single delegate pattern.
|
|||||||
<p>The main differences are that <code>PointerEvent</code> are fired for each
|
<p>The main differences are that <code>PointerEvent</code> are fired for each
|
||||||
touch point, whereas the <code>TouchEvent</code> collects multiple
|
touch point, whereas the <code>TouchEvent</code> collects multiple
|
||||||
<code>TouchPoints</code> into a single event. The basic PointMap and Interaction
|
<code>TouchPoints</code> into a single event. The basic PointMap and Interaction
|
||||||
classes unify this behavior by collection all contact points regardless
|
classes unify this behavior by collecting all contact points regardless
|
||||||
of their original mouse, touch, or pointer events.</p>
|
of their original mouse, touch, or pointer events.</p>
|
||||||
<h2>
|
<h2>
|
||||||
Point Maps
|
Point Maps
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
minScale: 0,
|
minScale: 0,
|
||||||
maxScale: 50,
|
maxScale: 50,
|
||||||
onTransform: event => {
|
onTransform: event => {
|
||||||
console.log('currentLevel', deepZoomImage1.currentLevel)
|
//console.log('currentLevel', deepZoomImage1.currentLevel)
|
||||||
deepZoomImage1.transformed(event)
|
deepZoomImage1.transformed(event)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,24 +1,14 @@
|
|||||||
import { Capabilities } from '../../capabilities.js'
|
import { Capabilities } from '../../capabilities.js'
|
||||||
import { Points } from '../../utils.js'
|
import { Points } from '../../utils.js'
|
||||||
import { deepZoomTileCache } from './tile.js'
|
import Tile from './tile.js'
|
||||||
import { Tiles } from './tiles.js'
|
import { Tiles } from './tiles.js'
|
||||||
|
|
||||||
function isEven(n) {
|
function isEven(n) {
|
||||||
return n % 2 == 0
|
return n % 2 == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function printTileCacheInfos() {
|
function printTileCacheInfos() {
|
||||||
let references = new Map()
|
Tile.printInfos()
|
||||||
let multiples = 0
|
|
||||||
for (let [url, tiles] of deepZoomTileCache.entries()) {
|
|
||||||
let count = tiles.size
|
|
||||||
references.set(url, count)
|
|
||||||
if (count > 1) {
|
|
||||||
multiples += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log({ multiples, references })
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* A utility class that holds information typically provided by DZI files, i.e.
|
* A utility class that holds information typically provided by DZI files, i.e.
|
||||||
@@ -374,6 +364,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
: 1
|
: 1
|
||||||
this.alpha = alpha
|
this.alpha = alpha
|
||||||
this.fastLoads = 0
|
this.fastLoads = 0
|
||||||
|
this.active = true
|
||||||
this.autoLoadTiles = autoLoadTiles
|
this.autoLoadTiles = autoLoadTiles
|
||||||
this.minimumLevel = minimumLevel
|
this.minimumLevel = minimumLevel
|
||||||
this.quadTrees = new Map() // url as keys, TileQuadNodes as values
|
this.quadTrees = new Map() // url as keys, TileQuadNodes as values
|
||||||
@@ -424,7 +415,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel
|
this.minimumLevel = deepZoomInfo.baseLevel
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles)
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center)
|
this.setupTiles(center)
|
||||||
}
|
}
|
||||||
@@ -645,7 +636,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) {
|
||||||
@@ -1027,6 +1018,9 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @param {boolean} debug - log debug infos
|
* @param {boolean} debug - log debug infos
|
||||||
*/
|
*/
|
||||||
transformed(event) {
|
transformed(event) {
|
||||||
|
if (!this.active) {
|
||||||
|
return
|
||||||
|
}
|
||||||
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') {
|
||||||
@@ -1074,6 +1068,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
activate() {
|
activate() {
|
||||||
|
this.active = true
|
||||||
this.destroyTilesAboveLevel(this.currentLevel)
|
this.destroyTilesAboveLevel(this.currentLevel)
|
||||||
this.ensureTiles(this.currentLevel, null)
|
this.ensureTiles(this.currentLevel, null)
|
||||||
//console.log("Activate Textures!", this.currentLevel)
|
//console.log("Activate Textures!", this.currentLevel)
|
||||||
@@ -1085,16 +1080,14 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
this.active = false
|
||||||
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') {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { deepZoomTileCache, Tile } from './tile.js'
|
import Tile from './tile.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Tile Loader component that can be plugged into a Tiles Layer.
|
* A Tile Loader component that can be plugged into a Tiles Layer.
|
||||||
@@ -28,6 +28,8 @@ export class TileLoader {
|
|||||||
schedule(url, col, row) {
|
schedule(url, col, row) {
|
||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
|
Tile.schedule(url)
|
||||||
this.map.set(url, [col, row])
|
this.map.set(url, [col, row])
|
||||||
this.loading.add(url)
|
this.loading.add(url)
|
||||||
this.loadQueue.push(url)
|
this.loadQueue.push(url)
|
||||||
@@ -37,6 +39,7 @@ export class TileLoader {
|
|||||||
unschedule(url) {
|
unschedule(url) {
|
||||||
if (this.loaded.has(url)) this.loaded.delete(url)
|
if (this.loaded.has(url)) this.loaded.delete(url)
|
||||||
if (this.loading.has(url)) this.loading.delete(url)
|
if (this.loading.has(url)) this.loading.delete(url)
|
||||||
|
Tile.unschedule(url)
|
||||||
this.loadQueue = this.loadQueue.filter(item => item != url)
|
this.loadQueue = this.loadQueue.filter(item => item != url)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,16 +99,13 @@ export class PIXITileLoader extends TileLoader {
|
|||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
if (deepZoomTileCache.has(url)) {
|
Tile.schedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url)
|
let reusableTexture = Tile.textureAvailable(url)
|
||||||
for (let tile of tiles.values()) {
|
if (reusableTexture) {
|
||||||
//console.log("Reusing cached texture", tile.parent)
|
if (this.debug) console.log('Texture reusable', reusableTexture)
|
||||||
let texture = tile.texture
|
this._textureAvailable(url, col, row, reusableTexture)
|
||||||
this._textureAvailable(url, col, row, texture)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let texture = PIXI.utils.TextureCache[url]
|
let texture = PIXI.utils.TextureCache[url]
|
||||||
if (texture) {
|
if (texture) {
|
||||||
if (this.debug) console.log('Texture already loaded', texture)
|
if (this.debug) console.log('Texture already loaded', texture)
|
||||||
@@ -160,8 +160,8 @@ export class PIXITileLoader extends TileLoader {
|
|||||||
_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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,100 @@
|
|||||||
|
/* ES Lint */
|
||||||
|
/* globals PIXI, console*/
|
||||||
|
|
||||||
export const deepZoomTileCache = new Map()
|
const registeredTiles = new Map()
|
||||||
|
const pendingTiles = new Map()
|
||||||
|
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
||||||
|
let keepTextures = 0
|
||||||
|
const keptTextures = []
|
||||||
|
|
||||||
/** The current Tile implementation simply uses PIXI.Sprites.
|
/** The current Tile implementation simply uses PIXI.Sprites.
|
||||||
*
|
*
|
||||||
* BTW: PIXI.extras.TilingSprite is not appropriate. It should be used for
|
* BTW: PIXI.extras.TilingSprite is not appropriate. It should be used for
|
||||||
* repeating patterns.
|
* repeating patterns.
|
||||||
**/
|
**/
|
||||||
export class Tile extends PIXI.Sprite {
|
export default class Tile extends PIXI.Sprite {
|
||||||
constructor(texture, url) {
|
constructor(texture, url) {
|
||||||
super(texture)
|
super(texture)
|
||||||
this.url = url
|
this.url = url
|
||||||
this.register(url)
|
this.register(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static method to enable keeping of base textures
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} value
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static enableKeepTextures(value = 1000) {
|
||||||
|
keepTextures = value
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks the given url as pending. Pending tiles should not be destroyed
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static schedule(url) {
|
||||||
|
let count = 0
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
count = pendingTiles.get(url)
|
||||||
|
}
|
||||||
|
pendingTiles.set(url, count + 1)
|
||||||
|
// console.log("Tile.scheduled", url, pendingTiles.size)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true iff the url is pending
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static isPending(url) {
|
||||||
|
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.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static unschedule(url) {
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
let count = pendingTiles.get(url)
|
||||||
|
if (count > 1) {
|
||||||
|
pendingTiles.set(url, count - 1)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pendingTiles.clear(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log("Tile.unscheduled", url, pendingTiles.size)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a tile from image using the PIXI.Texture.fromImage method.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} imageId
|
||||||
|
* @param {*} crossorigin
|
||||||
|
* @param {*} scaleMode
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
static fromImage(imageId, crossorigin, scaleMode) {
|
static fromImage(imageId, crossorigin, scaleMode) {
|
||||||
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
||||||
}
|
}
|
||||||
@@ -26,13 +107,14 @@ export class Tile extends PIXI.Sprite {
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
register(url, debug = false) {
|
register(url, debug = false) {
|
||||||
if (deepZoomTileCache.has(url)) {
|
Tile.unschedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url)
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url)
|
||||||
tiles.add(this)
|
tiles.add(this)
|
||||||
if (debug) console.log("Tile.register", url, tiles.size)
|
if (debug) console.log("Tile.register", url, tiles.size)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deepZoomTileCache.set(url, new Set([this]))
|
registeredTiles.set(url, new Set([this]))
|
||||||
if (debug) console.log("Tile.register", url, 1)
|
if (debug) console.log("Tile.register", url, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,10 +126,11 @@ export class Tile extends PIXI.Sprite {
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
unregister() {
|
unregister() {
|
||||||
let tiles = deepZoomTileCache.get(this.url)
|
let tiles = registeredTiles.get(this.url)
|
||||||
tiles.delete(this)
|
tiles.delete(this)
|
||||||
if (tiles.size == 0) {
|
if (tiles.size == 0) {
|
||||||
deepZoomTileCache.delete(this.url)
|
registeredTiles.delete(this.url)
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return tiles.size
|
return tiles.size
|
||||||
}
|
}
|
||||||
@@ -60,14 +143,32 @@ export class Tile extends PIXI.Sprite {
|
|||||||
*/
|
*/
|
||||||
destroy(options, debug = false) {
|
destroy(options, debug = false) {
|
||||||
let count = this.unregister()
|
let count = this.unregister()
|
||||||
if (count <= 0) {
|
|
||||||
|
if (keepTextures > 0) {
|
||||||
|
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()
|
||||||
|
if (Tile.isObsolete(url)) {
|
||||||
|
texture.destroy(true) // Destroy base as well
|
||||||
|
if (debug) console.log("Destroying texture and baseTexture", url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// No longer registered and not pending
|
||||||
|
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", deepZoomTileCache.size, opts)
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let opts = { children: true, texture: false, baseTexture: false }
|
let opts = { children: true, texture: false, baseTexture: false }
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts)
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
super.destroy(opts)
|
super.destroy(opts)
|
||||||
}
|
}
|
||||||
if (this.parent != null) {
|
if (this.parent != null) {
|
||||||
@@ -77,3 +178,45 @@ export class Tile extends PIXI.Sprite {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an available texture that can be reused
|
||||||
|
*
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static textureAvailable(url) {
|
||||||
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url)
|
||||||
|
for (let tile of tiles.values()) {
|
||||||
|
//console.log("Reusing cached texture", tile.parent)
|
||||||
|
return tile.texture
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
let references = new Map()
|
||||||
|
let multiples = 0
|
||||||
|
for (let [url, tiles] of registeredTiles.entries()) {
|
||||||
|
let count = tiles.size
|
||||||
|
references.set(url, count)
|
||||||
|
if (count > 1) {
|
||||||
|
multiples += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log({ multiples, references })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 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: 37 KiB After Width: | Height: | Size: 37 KiB |
@@ -173,11 +173,16 @@ class Throwable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now()
|
let t = performance.now()
|
||||||
let dt = t - this.lastframe
|
let dt = t - this.lastframe
|
||||||
this.lastframe = t
|
this.lastframe = t
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime()
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity)
|
let next = this.nextVelocity(this.velocity)
|
||||||
let prevLength = Points.length(this.velocity)
|
let prevLength = Points.length(this.velocity)
|
||||||
@@ -1434,7 +1439,7 @@ export class DOMScatter extends AbstractScatter {
|
|||||||
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected))
|
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected))
|
||||||
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected))
|
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected))
|
||||||
|
|
||||||
if (this.element.offsetWidth + resizeW / this.scale > this.width * 0.3 && this.element.offsetHeight + resizeH / this.scale > this.height * 0.3) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
if ((this.element.offsetWidth + resizeW) / this.scale > this.width * 0.5 / this.scale && (this.element.offsetHeight + resizeH) / this.scale > this.height * 0.3 / this.scale) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
||||||
|
|
||||||
this.oldX = e.clientX
|
this.oldX = e.clientX
|
||||||
this.oldY = e.clientY
|
this.oldY = e.clientY
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "iwmlib",
|
"name": "iwmlib",
|
||||||
"version": "1.0.9",
|
"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": {
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
"gulp-uglify": "^3.0.2"
|
"gulp-uglify": "^3.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"fs-extra": "^8.0.1",
|
||||||
"gsap": "^2.1.3",
|
"gsap": "^2.1.3",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"optimal-select": "^4.0.1",
|
"optimal-select": "^4.0.1",
|
||||||
|
|||||||