Fixed resize fullscreen bug.

This commit is contained in:
Sebastian Kupke
2022-04-29 10:28:59 +02:00
parent eff934e8b5
commit 7f068c5d94
5 changed files with 11524 additions and 98 deletions
+30 -31
View File
@@ -9,9 +9,9 @@
static implementationError(klass) {
let interfaceKeys = Reflect.ownKeys(this.prototype);
let classKeys = Reflect.ownKeys(klass.prototype);
Reflect.ownKeys(klass.prototype);
for (let key of interfaceKeys) {
let interfaceDesc = this.prototype[key];
this.prototype[key];
let classDesc = klass.prototype[key];
if (typeof classDesc == 'undefined') return 'Missing ' + key
}
@@ -3148,8 +3148,7 @@
*/
class ScatterEvent extends BaseEvent {
constructor(
target,
{ translate = { x: 0, y: 0 }, scale = null, rotate = 0, about = null, fast = false, type = null } = {}
target, { translate = { x: 0, y: 0 }, scale = null, rotate = 0, about = null, fast = false, type = null } = {}
) {
super('scatterTransformed', { target: target });
this.translate = translate;
@@ -3210,7 +3209,7 @@
this.velocity = null;
this.timestamp = null;
this.onThrowFinished = onThrowFinished;
//console.log("onThrowFinished", onThrowFinished)
//console.log("onThrowFinished", onThrowFinished)
}
observeVelocity() {
@@ -3288,7 +3287,7 @@
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 prevLength = Points$1.length(this.velocity);
let nextLength = Points$1.length(next);
@@ -3486,7 +3485,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) {
@@ -3507,6 +3506,8 @@
}
this.transform(delta, zoom, rotate, delta.about);
this.addVelocity(delta); // uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
if (zoom != 1) this.interactionAnchor = delta.about;
}
}
@@ -3571,10 +3572,10 @@
keepOnStage(velocity, collision = 0.5) {
let stagePolygon = this.containerPolygon;
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
if (!stagePolygon) return { x: 0, y: 0 }
let polygon = this.polygon;
this.polygon;
let bounced = this.bouncing();
if (bounced) {
let stage = this.containerBounds;
@@ -3583,7 +3584,7 @@
let dx = this.movableX ? velocity.x : 0;
let dy = this.movableY ? velocity.y : 0;
let factor = this.throwDamping;
// if (recentered) {
// if (recentered) {
if (x < 0) {
dx = -dx;
factor = collision;
@@ -3619,10 +3620,10 @@
onComplete: this.close.bind(this)
});
} else if (this.scale < this.minScale + this.scaleCloseThreshold) {
this.zoom(this.minScale + this.scaleCloseThreshold, {
animate: 0.4
});
}
this.zoom(this.minScale + this.scaleCloseThreshold, {
animate: 0.4
});
}
}
rotateDegrees(degrees, anchor) {
@@ -3725,7 +3726,7 @@
let newOrigin = Points$1.arc(anchor, beta + rotate, distance * thresholdedZoom);
let extra = Points$1.subtract(newOrigin, origin);
const anchorOffset = Points$1.subtract(anchor, origin);
// this._move(offset)
// this._move(offset)
this.scale = newScale;
this.rotation += rotate;
let offset = Points$1.negate(anchorOffset);
@@ -4015,8 +4016,7 @@
* @param {DOM node} debugCanvas - Shows debug infos about touches if not null
*/
constructor(
element,
{
element, {
stopEvents = 'auto',
claimEvents = true,
useCapture = true,
@@ -4180,8 +4180,7 @@
class DOMScatter$1 extends AbstractScatter {
constructor(
element,
container,
{
container, {
startScale = 1.0,
minScale = 0.1,
maxScale = 1.0,
@@ -4378,10 +4377,10 @@
let r = this.bounds;
let w2 = r.width / 2;
let h2 = r.height / 2;
// if (this.resizable) {
// w2 *= this.scale
// h2 *= this.scale
// }
// if (this.resizable) {
// w2 *= this.scale
// h2 *= this.scale
// }
var x = r.left + w2;
var y = r.top + h2;
return { x, y }
@@ -4501,7 +4500,7 @@
}
this._x = x;
this._y = y;
// this.addVelocity({ x: delta.x, y: delta.y }) uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
// this.addVelocity({ x: delta.x, y: delta.y }) uo: reverted commit fa0256d782dd498c6d3e51321260ca375ca9f855
TweenLite.set(this.element, { x, y });
}
@@ -6258,7 +6257,7 @@
/** Configuration object. Return default styles as CSS values.
*/
defaultStyle() {
let padding = this.padding;
this.padding;
let style = {
maxWidth: this.maxWidth + 'px',
zIndex: this.zIndex,
@@ -6537,7 +6536,7 @@
* @memberof Popup
*/
static targetCenter(event) {
let target = event.target;
event.target;
let x = event.pageX;
let y = event.pageY;
let rect = Popup$1.targetRect(event);
@@ -7583,7 +7582,7 @@
reorderArguments(params) {
// first parameter
//--------------------
const element = params[0];
params[0];
// other parameter
//--------------------
@@ -8253,7 +8252,7 @@
let svg = 'http://www.w3.org/2000/svg';
let xlink = 'http://www.w3.org/1999/xlink';
let svgGroup = element.parentNode;
element.parentNode;
let src = image.getAttributeNS(xlink, 'href');
@@ -9080,7 +9079,7 @@
let cx = target.getAttribute('cx');
let cy = target.getAttribute('cy');
let r = target.getAttribute('r');
let radius = r.endsWith('%') ? (parseFloat(r) / 100) * width : parseFloat(r);
r.endsWith('%') ? (parseFloat(r) / 100) * width : parseFloat(r);
let x = cx.endsWith('%') ? (parseFloat(cx) / 100) * width : cx;
let y = cy.endsWith('%') ? (parseFloat(cy) / 100) * height : cx;
@@ -11303,4 +11302,4 @@
window.Highlight = Highlight;
window.Theme = Theme;
}());
})();