modern-canvas 0.27.3 → 0.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8394,15 +8394,15 @@ var Da = class extends Gr {
|
|
|
8394
8394
|
let e = a.position?.x ?? 0, o = a.position?.y ?? 0, s = a.size?.width ?? 0, c = a.size?.height ?? 0;
|
|
8395
8395
|
e < t && (t = e), o < n && (n = o), e + s > r && (r = e + s), o + c > i && (i = o + c);
|
|
8396
8396
|
}
|
|
8397
|
-
let a = this.size.width, o = this.size.height;
|
|
8397
|
+
let a = this.size.width, o = this.size.height, s = (e) => Math.abs(e) < 1 ? 0 : e, c = s(Math.min(0, t)), l = s(Math.max(0, r - a)), u = s(Math.min(0, n)), d = s(Math.max(0, i - o));
|
|
8398
8398
|
return {
|
|
8399
8399
|
x: {
|
|
8400
|
-
min:
|
|
8401
|
-
max:
|
|
8400
|
+
min: c,
|
|
8401
|
+
max: l
|
|
8402
8402
|
},
|
|
8403
8403
|
y: {
|
|
8404
|
-
min:
|
|
8405
|
-
max:
|
|
8404
|
+
min: u,
|
|
8405
|
+
max: d
|
|
8406
8406
|
},
|
|
8407
8407
|
content: {
|
|
8408
8408
|
w: r - Math.min(0, t),
|
|
@@ -8527,6 +8527,21 @@ var Da = class extends Gr {
|
|
|
8527
8527
|
return !1;
|
|
8528
8528
|
}
|
|
8529
8529
|
input(e, t) {
|
|
8530
|
+
if (this._overflowHidden && (t === "pointerdown" || t === "pointermove" || t === "pointerup")) {
|
|
8531
|
+
let { screenX: n, screenY: r } = e;
|
|
8532
|
+
if (n && r) {
|
|
8533
|
+
let i = {
|
|
8534
|
+
x: n,
|
|
8535
|
+
y: r
|
|
8536
|
+
};
|
|
8537
|
+
this.getViewport()?.toCanvasGlobal(i, i);
|
|
8538
|
+
let a = this.globalAabb;
|
|
8539
|
+
if (i.x < a.min.x || i.x >= a.min.x + a.size.x || i.y < a.min.y || i.y >= a.min.y + a.size.y) {
|
|
8540
|
+
this.isVisibleInTree() && this._input(e, t);
|
|
8541
|
+
return;
|
|
8542
|
+
}
|
|
8543
|
+
}
|
|
8544
|
+
}
|
|
8530
8545
|
let n = this.getChildren(!0);
|
|
8531
8546
|
for (let r = n.length - 1; r >= 0; r--) n[r].input(e, t);
|
|
8532
8547
|
this.isVisibleInTree() && this._input(e, t);
|