Version 1.1.1.

This commit is contained in:
Sebastian Kupke 2021-02-24 16:15:20 +01:00
parent 1b4eee6498
commit d0ae8893cc
2 changed files with 22 additions and 12 deletions

17
dist/iwmlib.js vendored
View File

@ -2619,8 +2619,8 @@
if (Events.isCaptured(event)) { if (Events.isCaptured(event)) {
return false return false
} }
let captured = this.target.capture(event);
return captured return this.target.capture ? this.target.capture(event) : false
} }
getPosition(event) { getPosition(event) {
@ -3218,6 +3218,9 @@
let t = performance.now(); let t = performance.now();
let dt = t - this.lastframe; let dt = t - this.lastframe;
this.lastframe = t; this.lastframe = t;
// When number is not set or is zero. Use one instead.
let number = delta.number ? delta.number : 1;
if (dt > 0) { if (dt > 0) {
// Avoid division by zero errors later on // Avoid division by zero errors later on
// and consider the number of involved pointers sind addVelocity will be called by the // and consider the number of involved pointers sind addVelocity will be called by the
@ -3225,13 +3228,14 @@
let velocity = { let velocity = {
t: t, t: t,
dt: dt, dt: dt,
dx: delta.x / delta.number, dx: delta.x / number,
dy: delta.y / delta.number dy: delta.y / number
}; };
this.velocities.push(velocity); this.velocities.push(velocity);
while (this.velocities.length > buffer) { while (this.velocities.length > buffer) {
this.velocities.shift(); this.velocities.shift();
} }
} }
} }
@ -3479,7 +3483,6 @@
let delta = interaction.delta(); let delta = interaction.delta();
if (delta != null) { if (delta != null) {
this.addVelocity(delta);
let rotate = delta.rotate; let rotate = delta.rotate;
let zoom = delta.zoom; let zoom = delta.zoom;
if (this.maxRotation != null) { if (this.maxRotation != null) {
@ -3679,6 +3682,7 @@
} }
_move(delta) { _move(delta) {
this.addVelocity(delta);
this.x += this.movableX ? delta.x : 0; this.x += this.movableX ? delta.x : 0;
this.y += this.movableX ? delta.y : 0; this.y += this.movableX ? delta.y : 0;
} }
@ -4493,7 +4497,8 @@
} }
this._x = x; this._x = x;
this._y = y; this._y = y;
TweenLite.set(this.element, { x: x, y: y }); this.addVelocity({ x: delta.x, y: delta.y });
TweenLite.set(this.element, { x, y });
} }
resizeAfterTransform(zoom) { resizeAfterTransform(zoom) {

17
dist/iwmlib.pixi.js vendored
View File

@ -6178,8 +6178,8 @@
if (Events$1.isCaptured(event)) { if (Events$1.isCaptured(event)) {
return false return false
} }
let captured = this.target.capture(event);
return captured return this.target.capture ? this.target.capture(event) : false
} }
getPosition(event) { getPosition(event) {
@ -6768,6 +6768,9 @@
let t = performance.now(); let t = performance.now();
let dt = t - this.lastframe; let dt = t - this.lastframe;
this.lastframe = t; this.lastframe = t;
// When number is not set or is zero. Use one instead.
let number = delta.number ? delta.number : 1;
if (dt > 0) { if (dt > 0) {
// Avoid division by zero errors later on // Avoid division by zero errors later on
// and consider the number of involved pointers sind addVelocity will be called by the // and consider the number of involved pointers sind addVelocity will be called by the
@ -6775,13 +6778,14 @@
let velocity = { let velocity = {
t: t, t: t,
dt: dt, dt: dt,
dx: delta.x / delta.number, dx: delta.x / number,
dy: delta.y / delta.number dy: delta.y / number
}; };
this.velocities.push(velocity); this.velocities.push(velocity);
while (this.velocities.length > buffer) { while (this.velocities.length > buffer) {
this.velocities.shift(); this.velocities.shift();
} }
} }
} }
@ -7029,7 +7033,6 @@
let delta = interaction.delta(); let delta = interaction.delta();
if (delta != null) { if (delta != null) {
this.addVelocity(delta);
let rotate = delta.rotate; let rotate = delta.rotate;
let zoom = delta.zoom; let zoom = delta.zoom;
if (this.maxRotation != null) { if (this.maxRotation != null) {
@ -7229,6 +7232,7 @@
} }
_move(delta) { _move(delta) {
this.addVelocity(delta);
this.x += this.movableX ? delta.x : 0; this.x += this.movableX ? delta.x : 0;
this.y += this.movableX ? delta.y : 0; this.y += this.movableX ? delta.y : 0;
} }
@ -7863,7 +7867,8 @@
} }
this._x = x; this._x = x;
this._y = y; this._y = y;
TweenLite.set(this.element, { x: x, y: y }); this.addVelocity({ x: delta.x, y: delta.y });
TweenLite.set(this.element, { x, y });
} }
resizeAfterTransform(zoom) { resizeAfterTransform(zoom) {