Merge branch 'master' into obersalzberg
# Conflicts: # dist/iwmlib.js # dist/iwmlib.pixi.js
This commit is contained in:
Vendored
+32
-31
@@ -429,10 +429,10 @@
|
||||
window.addEventListener(
|
||||
'error',
|
||||
event => {
|
||||
if (typeof(event.error) == 'undefined') {
|
||||
if (typeof event.error == 'undefined') {
|
||||
// This sometimes happens in Edge. Since we have no error
|
||||
// position, we cannot do much beside an info log.
|
||||
console.info("Catched undefined error", event);
|
||||
console.info('Catched undefined error', event);
|
||||
return
|
||||
}
|
||||
this.appendError(event.error, event.filename);
|
||||
@@ -873,7 +873,7 @@
|
||||
return new Date(date.getTime() + 1)
|
||||
}
|
||||
|
||||
static * iterYears(start, end) {
|
||||
static *iterYears(start, end) {
|
||||
let date = this.create(start.getFullYear(), 0, 1);
|
||||
while (date <= end) {
|
||||
yield date;
|
||||
@@ -882,7 +882,7 @@
|
||||
yield date;
|
||||
}
|
||||
|
||||
static * iterMonths(year, limit = 12) {
|
||||
static *iterMonths(year, limit = 12) {
|
||||
let month = 0;
|
||||
while (month < limit) {
|
||||
let date = this.create(year.getFullYear(), month, 1);
|
||||
@@ -891,7 +891,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
static * iterMonthsOfYears(years) {
|
||||
static *iterMonthsOfYears(years) {
|
||||
for (let year of years) {
|
||||
for (let month of this.iterMonths(year)) {
|
||||
yield month;
|
||||
@@ -899,7 +899,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
static * iterDays(month) {
|
||||
static *iterDays(month) {
|
||||
let day = 1;
|
||||
let limit = Dates.daysInMonth(month);
|
||||
while (day <= limit) {
|
||||
@@ -909,7 +909,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
static * iterDaysOfMonths(months) {
|
||||
static *iterDaysOfMonths(months) {
|
||||
for (let month of months) {
|
||||
for (let day of this.iterDays(month)) {
|
||||
yield day;
|
||||
@@ -1087,16 +1087,12 @@
|
||||
static distanceToRect(p, r) {
|
||||
let dx = 0;
|
||||
let dy = 0;
|
||||
if (p.x < r.x)
|
||||
dx = p.x - r.x;
|
||||
else if (p.x > r.x + r.width)
|
||||
dx = p.x - (r.x + r.width);
|
||||
if (p.y < r.y)
|
||||
dy = p.y - r.y;
|
||||
else if (p.y > r.y + r.height)
|
||||
dy = p.y - (r.y + r.height);
|
||||
if (p.x < r.x) dx = p.x - r.x;
|
||||
else if (p.x > r.x + r.width) dx = p.x - (r.x + r.width);
|
||||
if (p.y < r.y) dy = p.y - r.y;
|
||||
else if (p.y > r.y + r.height) dy = p.y - (r.y + r.height);
|
||||
return Math.sqrt(dx * dx + dy * dy)
|
||||
/* let cx = Math.max(Math.min(p.x, r.x + r.width), r.x)
|
||||
/* let cx = Math.max(Math.min(p.x, r.x + r.width), r.x)
|
||||
let cy = Math.max(Math.min(p.y, r.y + r.height), r.y)
|
||||
let result = Math.sqrt((p.x - cx) * (p.x - cx) + (p.y - cy) * (p.y - cy))
|
||||
console.log("distanceToRect", p, r, result)
|
||||
@@ -1140,8 +1136,7 @@
|
||||
const i = sets.reduce((m, s, i) => (s.size < sets[m].size ? i : m), 0);
|
||||
const [smallest] = sets.splice(i, 1);
|
||||
const res = new Set();
|
||||
for (let val of smallest)
|
||||
if (sets.every(s => s.has(val))) res.add(val);
|
||||
for (let val of smallest) if (sets.every(s => s.has(val))) res.add(val);
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -1690,11 +1685,11 @@
|
||||
next(nextValue) {
|
||||
// push new value to the end, and remove oldest one
|
||||
let removed = this.__push(nextValue);
|
||||
// smooth value using all values from buffer
|
||||
// smooth value using all values from buffer
|
||||
let result = this.buffer.reduce((last, current) => {
|
||||
return this.smoothing * current + (1 - this.smoothing) * last
|
||||
}, removed);
|
||||
// replace smoothed value
|
||||
return this.smoothing * current + (1 - this.smoothing) * last
|
||||
}, removed);
|
||||
// replace smoothed value
|
||||
this.buffer[this.buffer.length - 1] = result;
|
||||
return result
|
||||
}
|
||||
@@ -3491,6 +3486,7 @@
|
||||
let delta = interaction.delta();
|
||||
|
||||
if (delta != null) {
|
||||
this.addVelocity(delta); // uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
|
||||
let rotate = delta.rotate;
|
||||
let zoom = delta.zoom;
|
||||
if (this.maxRotation != null) {
|
||||
@@ -3690,7 +3686,7 @@
|
||||
}
|
||||
|
||||
_move(delta) {
|
||||
this.addVelocity(delta);
|
||||
// this.addVelocity(delta) uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
|
||||
this.x += this.movableX ? delta.x : 0;
|
||||
this.y += this.movableX ? delta.y : 0;
|
||||
}
|
||||
@@ -3732,7 +3728,7 @@
|
||||
// this._move(offset)
|
||||
this.scale = newScale;
|
||||
this.rotation += rotate;
|
||||
let offset = Points$1.negate(offset);
|
||||
let offset = Points$1.negate(anchorOffset);
|
||||
offset = Points$1.add(offset, extra);
|
||||
offset = Points$1.add(offset, translate);
|
||||
this._move(Points$1.add(anchorOffset, offset));
|
||||
@@ -4505,7 +4501,7 @@
|
||||
}
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this.addVelocity({ x: delta.x, y: delta.y });
|
||||
// this.addVelocity({ x: delta.x, y: delta.y }) uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
|
||||
TweenLite.set(this.element, { x, y });
|
||||
}
|
||||
|
||||
@@ -6664,9 +6660,14 @@
|
||||
if (this.autoClose) {
|
||||
this.close();
|
||||
}
|
||||
setTimeout((event, key) => {
|
||||
func(event, key);
|
||||
}, 20, event, key);
|
||||
setTimeout(
|
||||
(event, key) => {
|
||||
func(event, key);
|
||||
},
|
||||
20,
|
||||
event,
|
||||
key
|
||||
);
|
||||
}
|
||||
|
||||
/** Update the menu item denoted by key.
|
||||
@@ -8585,7 +8586,7 @@
|
||||
*/
|
||||
return html.replace(
|
||||
/<\s*(a|video|img|image|circle)\s(.*?)(xlink:href|href|src)\s*=\s*["'](\..*?)["']\s*(.*?)>/g,
|
||||
function () {
|
||||
function() {
|
||||
let path = that._getRelativePath(arguments[4]);
|
||||
const tag = `<${arguments[1]} ${arguments[2]} ${arguments[3]}="${path}" ${arguments[5]}>`;
|
||||
/* if (that.debug) */ console.log('Adjusted: ', tag);
|
||||
@@ -8614,7 +8615,7 @@
|
||||
return new Promise((resolve, reject) => {
|
||||
let request = new XMLHttpRequest();
|
||||
|
||||
request.onreadystatechange = function () {
|
||||
request.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
if (this.status == 200 || Card._isLocal()) {
|
||||
try {
|
||||
@@ -9899,7 +9900,7 @@
|
||||
});
|
||||
},
|
||||
onUpdateParams: ['{self}'],
|
||||
onUpdate: function (self) {
|
||||
onUpdate: function(self) {
|
||||
let transform = self.target._gsTransform;
|
||||
|
||||
TweenLite.set(title, {
|
||||
|
||||
Reference in New Issue
Block a user