modern-canvas 0.27.19 → 0.27.21
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeChart as p, normalizeComments as m, normalizeConnection as h, normalizeFill as g, normalizeForeground as ee, normalizeOutline as te, normalizeShadow as ne, normalizeShape as re, normalizeTable as ie, normalizeText as ae, normalizeTextContent as oe, parseColor as se, property as _, stringifyFilter as ce } from "modern-idoc";
|
|
2
2
|
import { BoundingBox as le, Path2D as ue, Path2DSet as de, PathMeasure as fe, Transform2D as v, Vector2 as y, svgToDom as pe, svgToPath2DSet as me } from "modern-path2d";
|
|
3
3
|
import { extend as he } from "colord";
|
|
4
|
-
import
|
|
5
|
-
import { fonts as
|
|
6
|
-
import { Character as
|
|
4
|
+
import b from "colord/plugins/names";
|
|
5
|
+
import { fonts as ge } from "modern-font";
|
|
6
|
+
import { Character as _e, Text as ve } from "modern-text";
|
|
7
7
|
//#region src/core/decorators/customNode.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var ye = /* @__PURE__ */ new Map();
|
|
9
|
+
function x(e, t) {
|
|
10
10
|
return function(n) {
|
|
11
11
|
Object.defineProperty(n.prototype, "is", {
|
|
12
12
|
value: e,
|
|
@@ -14,19 +14,19 @@ function b(e, t) {
|
|
|
14
14
|
configurable: !0
|
|
15
15
|
}), t && Object.keys(t).forEach((e) => {
|
|
16
16
|
i(n, e, { fallback: t[e] });
|
|
17
|
-
}),
|
|
17
|
+
}), ye.set(e, n);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/core/global/createNode.ts
|
|
22
|
-
function
|
|
23
|
-
let n =
|
|
22
|
+
function be(e = "node", t = {}) {
|
|
23
|
+
let n = ye.get(e);
|
|
24
24
|
if (!n) throw Error(`Failed to createNode, tag: ${e}`);
|
|
25
25
|
return new n().setProperties(t);
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/core/global/Ticker.ts
|
|
29
|
-
var
|
|
29
|
+
var S = class {
|
|
30
30
|
static _queue = [];
|
|
31
31
|
static _currentTime = 0;
|
|
32
32
|
static _elapsed = 0;
|
|
@@ -83,12 +83,12 @@ var x = class {
|
|
|
83
83
|
this._queue = t;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
S.start();
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/core/global/nextTick.ts
|
|
89
|
-
async function
|
|
89
|
+
async function xe(e) {
|
|
90
90
|
return new Promise((t) => {
|
|
91
|
-
|
|
91
|
+
S.on(() => {
|
|
92
92
|
e?.(), t();
|
|
93
93
|
}, {
|
|
94
94
|
sort: 1,
|
|
@@ -98,11 +98,11 @@ async function Se(e) {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/core/shared/utils.ts
|
|
101
|
-
var
|
|
102
|
-
function
|
|
101
|
+
var Se = Math.PI, Ce = Se * 2;
|
|
102
|
+
function we(e) {
|
|
103
103
|
return !(e & e - 1) && !!e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Te(e, t, n) {
|
|
106
106
|
let r = Math.max(0, Math.floor(e)), i = Math.max(0, Math.floor(t)), a = Math.max(1, Math.floor(n)), o = [];
|
|
107
107
|
if (!r || !i) return o;
|
|
108
108
|
let s = Math.min(r, a), c = Math.min(i, a), l = Math.ceil(r / s), u = Math.ceil(i / c);
|
|
@@ -119,8 +119,8 @@ function Ee(e, t, n) {
|
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/core/shared/css.ts
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var Ee = /([\w-]+)\((.+?)\)/g, De = /[^,]+/g, Oe = /([-e.\d]+)(.*)/;
|
|
123
|
+
function ke(e) {
|
|
124
124
|
return Array.isArray(e) ? e.map((e) => ({
|
|
125
125
|
name: e.name,
|
|
126
126
|
args: e.args.map((e) => ({
|
|
@@ -132,31 +132,31 @@ function Ae(e) {
|
|
|
132
132
|
normalizedIntValue: e.normalizedDefaultIntValue
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let r =
|
|
137
|
-
return r.length ? r :
|
|
135
|
+
function Ae(e, t, n = {}) {
|
|
136
|
+
let r = je(t, n);
|
|
137
|
+
return r.length ? r : Ne(e, t, n);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function je(e, t = {}) {
|
|
140
140
|
let n = [], r;
|
|
141
|
-
for (; (r =
|
|
141
|
+
for (; (r = Ee.exec(e)) !== null;) {
|
|
142
142
|
let [, e, i] = r;
|
|
143
143
|
e && n.push({
|
|
144
144
|
name: e,
|
|
145
|
-
args:
|
|
145
|
+
args: Me(e, i, t)
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
return n;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Me(e, t, n = {}) {
|
|
151
151
|
let r = [], i, a = 0;
|
|
152
|
-
for (; (i =
|
|
152
|
+
for (; (i = De.exec(t)) !== null;) r.push(Ne(e, i[0], {
|
|
153
153
|
...n,
|
|
154
154
|
index: a++
|
|
155
155
|
}));
|
|
156
156
|
return r;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(
|
|
158
|
+
function Ne(e, t, n = {}) {
|
|
159
|
+
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(Oe), s = {
|
|
160
160
|
unit: o?.[2] ?? null,
|
|
161
161
|
value: t,
|
|
162
162
|
intValue: Number(o?.[1]),
|
|
@@ -176,7 +176,7 @@ function Pe(e, t, n = {}) {
|
|
|
176
176
|
s.normalizedIntValue = s.intValue / 100;
|
|
177
177
|
break;
|
|
178
178
|
case "rad":
|
|
179
|
-
s.normalizedIntValue = s.intValue /
|
|
179
|
+
s.normalizedIntValue = s.intValue / Ce;
|
|
180
180
|
break;
|
|
181
181
|
case "deg":
|
|
182
182
|
s.normalizedIntValue = s.intValue / 360;
|
|
@@ -199,57 +199,57 @@ function Pe(e, t, n = {}) {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region src/core/shared/dom.ts
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var Pe = "WebGL2RenderingContext" in globalThis, Fe = "ImageBitmap" in globalThis, Ie = "ResizeObserver" in globalThis, Le = "PointerEvent" in globalThis, Re = "WheelEvent" in globalThis, ze = "MouseEvent" in globalThis, Be = "ontouchstart" in globalThis, Ve = "onclick" in globalThis, He = "createImageBitmap" in globalThis, Ue = "AudioContext" in globalThis, We = "webkitAudioContext" in globalThis, Ge = "OfflineAudioContext" in globalThis, Ke = "webkitOfflineAudioContext" in globalThis, qe = Ue || We, Je = typeof window < "u", Ye = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Xe = globalThis.devicePixelRatio || 1, Ze = (e) => typeof e == "object" && !!e && e.nodeType === 1, Qe = (e) => Ze(e) && e.tagName === "VIDEO", $e = (e) => Ze(e) && e.tagName === "IMG";
|
|
203
|
+
function et(e) {
|
|
204
204
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
206
|
+
function tt(e) {
|
|
207
|
+
return Pe && e instanceof globalThis.WebGL2RenderingContext;
|
|
208
208
|
}
|
|
209
|
-
var
|
|
210
|
-
function
|
|
211
|
-
|
|
209
|
+
var nt;
|
|
210
|
+
function rt(e) {
|
|
211
|
+
nt = e;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return
|
|
213
|
+
function it() {
|
|
214
|
+
return nt;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
217
|
-
function
|
|
218
|
-
|
|
216
|
+
var at;
|
|
217
|
+
function ot(e) {
|
|
218
|
+
at = e;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
220
|
+
function st() {
|
|
221
|
+
return at;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function C(e, t) {
|
|
224
224
|
let n;
|
|
225
|
-
return
|
|
225
|
+
return nt ? n = nt(e, t) : Je && (n = globalThis.document.createElement("canvas")), n && (e !== void 0 && (n.width = e), t !== void 0 && (n.height = t)), n;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ct(e, t = globalThis.location) {
|
|
228
228
|
if (e.startsWith("data:") || !t || typeof document > "u") return "";
|
|
229
229
|
let n = new URL(e, document.baseURI);
|
|
230
230
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
232
|
+
function lt(e, t, n) {
|
|
233
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = ct(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
236
|
//#region src/core/shared/geometryRevision.ts
|
|
237
|
-
var
|
|
238
|
-
function
|
|
239
|
-
return
|
|
237
|
+
var ut = 0;
|
|
238
|
+
function dt() {
|
|
239
|
+
return ut;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
|
|
241
|
+
function ft() {
|
|
242
|
+
ut++;
|
|
243
243
|
}
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region src/core/shared/id.ts
|
|
246
|
-
var
|
|
247
|
-
function
|
|
248
|
-
return ++
|
|
246
|
+
var pt = 0;
|
|
247
|
+
function mt() {
|
|
248
|
+
return ++pt;
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/core/input/InputEvent.ts
|
|
252
|
-
var
|
|
252
|
+
var ht = class e {
|
|
253
253
|
cursor;
|
|
254
254
|
bubbles = !1;
|
|
255
255
|
cancelBubble = !1;
|
|
@@ -284,14 +284,14 @@ var gt = class e {
|
|
|
284
284
|
initUIEvent(...e) {
|
|
285
285
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, gt = class extends ht {
|
|
288
288
|
getModifierState(...e) {
|
|
289
289
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
290
290
|
}
|
|
291
291
|
initKeyboardEvent(...e) {
|
|
292
292
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
293
293
|
}
|
|
294
|
-
},
|
|
294
|
+
}, _t = class extends ht {
|
|
295
295
|
client = {
|
|
296
296
|
x: 0,
|
|
297
297
|
y: 0
|
|
@@ -374,7 +374,7 @@ var gt = class e {
|
|
|
374
374
|
get globalY() {
|
|
375
375
|
return this.global.y;
|
|
376
376
|
}
|
|
377
|
-
},
|
|
377
|
+
}, vt = class extends _t {
|
|
378
378
|
width = 0;
|
|
379
379
|
height = 0;
|
|
380
380
|
isPrimary = !1;
|
|
@@ -384,20 +384,20 @@ var gt = class e {
|
|
|
384
384
|
getPredictedEvents() {
|
|
385
385
|
throw Error("getPredictedEvents is not supported!");
|
|
386
386
|
}
|
|
387
|
-
},
|
|
387
|
+
}, yt = class extends _t {
|
|
388
388
|
static DOM_DELTA_PIXEL = 0;
|
|
389
389
|
DOM_DELTA_PIXEL = 0;
|
|
390
390
|
static DOM_DELTA_LINE = 1;
|
|
391
391
|
DOM_DELTA_LINE = 1;
|
|
392
392
|
static DOM_DELTA_PAGE = 2;
|
|
393
393
|
DOM_DELTA_PAGE = 2;
|
|
394
|
-
},
|
|
394
|
+
}, bt = {
|
|
395
395
|
touchstart: "pointerdown",
|
|
396
396
|
touchend: "pointerup",
|
|
397
397
|
touchendoutside: "pointerupoutside",
|
|
398
398
|
touchmove: "pointermove",
|
|
399
399
|
touchcancel: "pointercancel"
|
|
400
|
-
},
|
|
400
|
+
}, xt = class extends e {
|
|
401
401
|
event;
|
|
402
402
|
target;
|
|
403
403
|
cursor = "default";
|
|
@@ -415,21 +415,21 @@ var gt = class e {
|
|
|
415
415
|
removeEventListeners() {
|
|
416
416
|
if (!this.setuped || !this.target) return;
|
|
417
417
|
let e = this.target.style;
|
|
418
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") :
|
|
418
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Le && (e.touchAction = ""), Le ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Be && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), typeof document < "u" && (document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp)), this.target = void 0, this.setuped = !1;
|
|
419
419
|
}
|
|
420
420
|
addEventListeners() {
|
|
421
421
|
if (this.setuped || !this.target) return;
|
|
422
422
|
let e = this.target.style;
|
|
423
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") :
|
|
423
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Le && (e.touchAction = "none")), Le ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Be && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), typeof document < "u" && (document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp)), this.setuped = !0;
|
|
424
424
|
}
|
|
425
425
|
normalize(e) {
|
|
426
426
|
let t = [];
|
|
427
|
-
if (
|
|
427
|
+
if (Be && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
428
428
|
let r = e.changedTouches[n];
|
|
429
429
|
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
|
|
430
430
|
}
|
|
431
|
-
else if (
|
|
432
|
-
else if (
|
|
431
|
+
else if (Re && e instanceof globalThis.WheelEvent) t.push(e);
|
|
432
|
+
else if (Le && e instanceof globalThis.PointerEvent) t.push(e);
|
|
433
433
|
else {
|
|
434
434
|
let n = e;
|
|
435
435
|
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = 1), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), t.push(n);
|
|
@@ -437,8 +437,8 @@ var gt = class e {
|
|
|
437
437
|
return t;
|
|
438
438
|
}
|
|
439
439
|
_clonePointerEvent(e) {
|
|
440
|
-
let t = new
|
|
441
|
-
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type =
|
|
440
|
+
let t = new vt();
|
|
441
|
+
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = bt[t.type] || t.type), t;
|
|
442
442
|
}
|
|
443
443
|
_copyInputEvent(e, t) {
|
|
444
444
|
e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
|
|
@@ -447,11 +447,11 @@ var gt = class e {
|
|
|
447
447
|
this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
448
448
|
}
|
|
449
449
|
_cloneWheelEvent(e) {
|
|
450
|
-
let t = new
|
|
450
|
+
let t = new yt();
|
|
451
451
|
return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
|
|
452
452
|
}
|
|
453
453
|
_cloneKeyboardEvent(e) {
|
|
454
|
-
let t = new
|
|
454
|
+
let t = new gt();
|
|
455
455
|
return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
|
|
456
456
|
}
|
|
457
457
|
setCursor(e = "default") {
|
|
@@ -499,25 +499,25 @@ var gt = class e {
|
|
|
499
499
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
500
500
|
};
|
|
501
501
|
_onPointerDown = (e) => {
|
|
502
|
-
if (
|
|
502
|
+
if (Be && e.pointerType === "touch") return;
|
|
503
503
|
let t = this.normalize(e);
|
|
504
504
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
505
505
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
506
506
|
};
|
|
507
507
|
_onPointerOver = (e) => {
|
|
508
|
-
if (!this.enableClickEvent ||
|
|
508
|
+
if (!this.enableClickEvent || Be && e.pointerType === "touch") return;
|
|
509
509
|
let t = this.normalize(e);
|
|
510
510
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
511
511
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
512
512
|
};
|
|
513
513
|
_onPointerMove = (e) => {
|
|
514
|
-
if (!this.enableMoveEvent ||
|
|
514
|
+
if (!this.enableMoveEvent || Be && e.pointerType === "touch") return;
|
|
515
515
|
let t = this.normalize(e);
|
|
516
516
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
517
517
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
518
518
|
};
|
|
519
519
|
_onPointerUp = (e) => {
|
|
520
|
-
if (!this.enableClickEvent ||
|
|
520
|
+
if (!this.enableClickEvent || Be && e.pointerType === "touch") return;
|
|
521
521
|
let t = e.target;
|
|
522
522
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
523
523
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -536,8 +536,8 @@ var gt = class e {
|
|
|
536
536
|
destroy() {
|
|
537
537
|
this.removeEventListeners(), super.destroy();
|
|
538
538
|
}
|
|
539
|
-
},
|
|
540
|
-
instanceId =
|
|
539
|
+
}, w = class extends n {
|
|
540
|
+
instanceId = mt();
|
|
541
541
|
destroyed = !1;
|
|
542
542
|
get json() {
|
|
543
543
|
return this.toJSON();
|
|
@@ -546,7 +546,7 @@ var gt = class e {
|
|
|
546
546
|
this.setProperties(e);
|
|
547
547
|
}
|
|
548
548
|
_nextTick() {
|
|
549
|
-
return
|
|
549
|
+
return xe();
|
|
550
550
|
}
|
|
551
551
|
equal(e) {
|
|
552
552
|
return !!(e && this.instanceId === e.instanceId);
|
|
@@ -555,13 +555,13 @@ var gt = class e {
|
|
|
555
555
|
destroy() {
|
|
556
556
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
557
557
|
}
|
|
558
|
-
},
|
|
558
|
+
}, St = class extends w {}, Ct = class extends St {};
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region src/core/math/Aabb2D.ts
|
|
561
|
-
function
|
|
561
|
+
function wt(e) {
|
|
562
562
|
return Number.isFinite(e) ? e : 0;
|
|
563
563
|
}
|
|
564
|
-
var
|
|
564
|
+
var Tt = class e {
|
|
565
565
|
get x() {
|
|
566
566
|
return this.min.x;
|
|
567
567
|
}
|
|
@@ -635,10 +635,10 @@ var Et = class e {
|
|
|
635
635
|
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new y(t.x, t.y, this._updateMax), this.size = new y(n.x, n.y, this._updateMax), this.max = new y(t.x + n.x, t.y + n.y, this._updateSize);
|
|
636
636
|
}
|
|
637
637
|
_updateSize() {
|
|
638
|
-
return this.size.set(
|
|
638
|
+
return this.size.set(wt(this.max.x - this.min.x), wt(this.max.y - this.min.y)), this;
|
|
639
639
|
}
|
|
640
640
|
_updateMax() {
|
|
641
|
-
return this.max.set(
|
|
641
|
+
return this.max.set(wt(this.min.x + this.size.x), wt(this.min.y + this.size.y)), this;
|
|
642
642
|
}
|
|
643
643
|
overlap(e, t) {
|
|
644
644
|
switch (t) {
|
|
@@ -694,8 +694,8 @@ var Et = class e {
|
|
|
694
694
|
};
|
|
695
695
|
//#endregion
|
|
696
696
|
//#region src/core/math/Color.ts
|
|
697
|
-
he([
|
|
698
|
-
var
|
|
697
|
+
he([b]);
|
|
698
|
+
var T = class {
|
|
699
699
|
get value() {
|
|
700
700
|
return this._value;
|
|
701
701
|
}
|
|
@@ -778,16 +778,16 @@ var w = class {
|
|
|
778
778
|
this.a
|
|
779
779
|
];
|
|
780
780
|
}
|
|
781
|
-
},
|
|
782
|
-
function
|
|
781
|
+
}, Et = Se / 180, Dt = 180 / Se;
|
|
782
|
+
function E(e, t, n) {
|
|
783
783
|
return Math.max(t, Math.min(e, n));
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function D(e, t, n) {
|
|
786
786
|
return (1 - n) * e + n * t;
|
|
787
787
|
}
|
|
788
788
|
//#endregion
|
|
789
789
|
//#region src/core/math/ColorMatrix.ts
|
|
790
|
-
var
|
|
790
|
+
var Ot = class {
|
|
791
791
|
_array = /* @__PURE__ */ new Float32Array(20);
|
|
792
792
|
constructor() {
|
|
793
793
|
this.identity();
|
|
@@ -917,7 +917,7 @@ var kt = class {
|
|
|
917
917
|
]);
|
|
918
918
|
}
|
|
919
919
|
invert(e = 1) {
|
|
920
|
-
let t =
|
|
920
|
+
let t = D(1, -1, e), n = D(0, 255, e);
|
|
921
921
|
return this.multiply([
|
|
922
922
|
t,
|
|
923
923
|
0,
|
|
@@ -942,21 +942,21 @@ var kt = class {
|
|
|
942
942
|
]);
|
|
943
943
|
}
|
|
944
944
|
sepia(e = 1) {
|
|
945
|
-
let t =
|
|
945
|
+
let t = E(e, 0, 1);
|
|
946
946
|
return this.multiply([
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
947
|
+
D(1, .393, t),
|
|
948
|
+
D(0, .7689999, t),
|
|
949
|
+
D(0, .18899999, t),
|
|
950
950
|
0,
|
|
951
951
|
0,
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
952
|
+
D(0, .349, t),
|
|
953
|
+
D(1, .6859999, t),
|
|
954
|
+
D(0, .16799999, t),
|
|
955
955
|
0,
|
|
956
956
|
0,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
957
|
+
D(0, .272, t),
|
|
958
|
+
D(0, .5339999, t),
|
|
959
|
+
D(1, .13099999, t),
|
|
960
960
|
0,
|
|
961
961
|
0,
|
|
962
962
|
0,
|
|
@@ -991,7 +991,7 @@ var kt = class {
|
|
|
991
991
|
]);
|
|
992
992
|
}
|
|
993
993
|
grayscale(e = 1) {
|
|
994
|
-
let t =
|
|
994
|
+
let t = E(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
|
|
995
995
|
return this.multiply([
|
|
996
996
|
n,
|
|
997
997
|
a,
|
|
@@ -1043,10 +1043,10 @@ var kt = class {
|
|
|
1043
1043
|
toArray() {
|
|
1044
1044
|
return this._array;
|
|
1045
1045
|
}
|
|
1046
|
-
},
|
|
1046
|
+
}, kt = class e extends Tt {
|
|
1047
1047
|
rotation;
|
|
1048
1048
|
get rotationDegrees() {
|
|
1049
|
-
return this.rotation /
|
|
1049
|
+
return this.rotation / Et;
|
|
1050
1050
|
}
|
|
1051
1051
|
constructor(...e) {
|
|
1052
1052
|
let t, n;
|
|
@@ -1056,7 +1056,7 @@ var kt = class {
|
|
|
1056
1056
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1057
1057
|
{
|
|
1058
1058
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1059
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1059
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / Et;
|
|
1060
1060
|
a = -a % 180;
|
|
1061
1061
|
let o = a / 180 * Math.PI, s = {
|
|
1062
1062
|
x: Math.cos(o),
|
|
@@ -1098,7 +1098,7 @@ var kt = class {
|
|
|
1098
1098
|
clone() {
|
|
1099
1099
|
return new e(this.toJSON());
|
|
1100
1100
|
}
|
|
1101
|
-
},
|
|
1101
|
+
}, At = class {
|
|
1102
1102
|
_array;
|
|
1103
1103
|
x = 0;
|
|
1104
1104
|
y = 0;
|
|
@@ -1122,12 +1122,12 @@ var kt = class {
|
|
|
1122
1122
|
};
|
|
1123
1123
|
//#endregion
|
|
1124
1124
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateMetadata.js
|
|
1125
|
-
function
|
|
1125
|
+
function O(e, t) {
|
|
1126
1126
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1127
1127
|
}
|
|
1128
1128
|
//#endregion
|
|
1129
1129
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
1130
|
-
function
|
|
1130
|
+
function k(e, t, n, r) {
|
|
1131
1131
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1132
1132
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1133
1133
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -1135,7 +1135,7 @@ function O(e, t, n, r) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
//#endregion
|
|
1137
1137
|
//#region src/core/os/MainLoop.ts
|
|
1138
|
-
var
|
|
1138
|
+
var jt = class extends w {
|
|
1139
1139
|
_starting = !1;
|
|
1140
1140
|
_nextDeltaTime = 0;
|
|
1141
1141
|
_startedProcess;
|
|
@@ -1149,13 +1149,13 @@ var Mt = class extends C {
|
|
|
1149
1149
|
super(), this._onTicker = this._onTicker.bind(this), this.setProperties(e);
|
|
1150
1150
|
}
|
|
1151
1151
|
start(e) {
|
|
1152
|
-
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e),
|
|
1152
|
+
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e), S.on(this._onTicker, { sort: 0 }));
|
|
1153
1153
|
}
|
|
1154
1154
|
stop() {
|
|
1155
|
-
this._starting && (this._starting = !1,
|
|
1155
|
+
this._starting && (this._starting = !1, S.off(this._onTicker, { sort: 0 }));
|
|
1156
1156
|
}
|
|
1157
1157
|
_onTicker() {
|
|
1158
|
-
let e =
|
|
1158
|
+
let e = S.elapsed * this.speed;
|
|
1159
1159
|
if ((this._nextDeltaTime -= e) <= 0) {
|
|
1160
1160
|
let t = (this._nextDeltaTime = this.spf) || e;
|
|
1161
1161
|
this.emit("process", t);
|
|
@@ -1165,12 +1165,12 @@ var Mt = class extends C {
|
|
|
1165
1165
|
super._destroy(), this.stop();
|
|
1166
1166
|
}
|
|
1167
1167
|
};
|
|
1168
|
-
|
|
1168
|
+
k([_({ fallback: 60 }), O("design:type", Number)], jt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], jt.prototype, "speed", void 0);
|
|
1169
1169
|
//#endregion
|
|
1170
1170
|
//#region src/core/reactivity.ts
|
|
1171
|
-
var
|
|
1172
|
-
function
|
|
1173
|
-
return !Object.prototype.hasOwnProperty.call(e,
|
|
1171
|
+
var Mt = "__v_skip";
|
|
1172
|
+
function Nt(e) {
|
|
1173
|
+
return !Object.prototype.hasOwnProperty.call(e, Mt) && Object.isExtensible(e) && Object.defineProperty(e, Mt, {
|
|
1174
1174
|
configurable: !0,
|
|
1175
1175
|
enumerable: !1,
|
|
1176
1176
|
value: !0
|
|
@@ -1178,14 +1178,14 @@ function Pt(e) {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
//#endregion
|
|
1180
1180
|
//#region src/core/renderers/gl/Batch2DEffect.ts
|
|
1181
|
-
var
|
|
1182
|
-
function
|
|
1181
|
+
var Pt = 1, Ft = 2;
|
|
1182
|
+
function It(e) {
|
|
1183
1183
|
return Math.min(255, Math.max(1, Math.round(e * 32) + 128));
|
|
1184
1184
|
}
|
|
1185
|
-
var
|
|
1185
|
+
var Lt = {
|
|
1186
1186
|
name: "strokeFeather",
|
|
1187
1187
|
fragment: "if (mod(floor(vFlags * 0.5), 2.0) > 0.5) {\n float w = 1.0 / max(fwidth(vUv.y), 1e-6);\n float d = min(vUv.y, 1.0 - vUv.y) * w;\n color *= clamp(d + 0.5, 0.0, 1.0) * clamp(w, 0.0, 1.0);\n }"
|
|
1188
|
-
},
|
|
1188
|
+
}, Rt = {
|
|
1189
1189
|
name: "flowStreak",
|
|
1190
1190
|
uniformDecls: "uniform vec3 uFlowColor;\nuniform float uFlowPeriod;",
|
|
1191
1191
|
uniformDefaults: {
|
|
@@ -1198,19 +1198,19 @@ var Rt = {
|
|
|
1198
1198
|
},
|
|
1199
1199
|
fragment: "if (vParam > 0.5) {\n float speed = (vParam - 128.0) / 32.0;\n float b = fract((uTime * speed - vUv.x / uFlowPeriod) * (speed < 0.0 ? -1.0 : 1.0));\n float s = b > 0.5 ? b - 1.0 : b;\n float streak = smoothstep(-0.045, -0.01, s) * (1.0 - smoothstep(0.02, 0.18, s));\n\n float w = 1.0 / max(fwidth(vUv.y), 1e-6);\n float px = abs(vUv.y - 0.5) * w;\n float corePx = w * 0.25;\n float core = clamp(corePx - px + 0.5, 0.0, 1.0);\n float halo = 1.0 - smoothstep(corePx, w * 0.5, px);\n\n vec4 line = color * core;\n line.rgb = mix(line.rgb, uFlowColor * line.a, streak);\n float glowA = streak * halo * (1.0 - core) * 0.55 * color.a;\n color = line + vec4(uFlowColor * glowA, glowA);\n }",
|
|
1200
1200
|
fragmentGl1: "if (vParam > 0.5) {\n float speed = (vParam - 128.0) / 32.0;\n float b = fract((uTime * speed - vUv.x / uFlowPeriod) * (speed < 0.0 ? -1.0 : 1.0));\n float s = b > 0.5 ? b - 1.0 : b;\n float streak = smoothstep(-0.045, -0.01, s) * (1.0 - smoothstep(0.02, 0.18, s));\n color.rgb = mix(color.rgb, uFlowColor * color.a, streak);\n }"
|
|
1201
|
-
},
|
|
1201
|
+
}, zt = /* @__PURE__ */ function(e) {
|
|
1202
1202
|
return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
|
|
1203
|
-
}({}),
|
|
1203
|
+
}({}), Bt = class {
|
|
1204
1204
|
native;
|
|
1205
|
-
target =
|
|
1205
|
+
target = zt.arrayBuffer;
|
|
1206
1206
|
byteLength = 0;
|
|
1207
1207
|
dirty = !0;
|
|
1208
1208
|
constructor(e) {
|
|
1209
1209
|
this.native = e;
|
|
1210
1210
|
}
|
|
1211
|
-
},
|
|
1211
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
1212
1212
|
return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
|
|
1213
|
-
}({}),
|
|
1213
|
+
}({}), Vt = class extends n {
|
|
1214
1214
|
screen = {
|
|
1215
1215
|
x: 0,
|
|
1216
1216
|
y: 0,
|
|
@@ -1229,12 +1229,12 @@ var Rt = {
|
|
|
1229
1229
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
|
|
1232
|
+
k([_({ fallback: Xe }), O("design:type", Number)], Vt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Vt.prototype, "view", void 0);
|
|
1233
1233
|
//#endregion
|
|
1234
1234
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1235
|
-
var
|
|
1235
|
+
var Ht = 0, Ut = class {
|
|
1236
1236
|
isUniformGroup = !0;
|
|
1237
|
-
uid = ++
|
|
1237
|
+
uid = ++Ht;
|
|
1238
1238
|
uniforms;
|
|
1239
1239
|
ubo;
|
|
1240
1240
|
isStatic;
|
|
@@ -1245,14 +1245,14 @@ var Ut = 0, Wt = class {
|
|
|
1245
1245
|
update() {
|
|
1246
1246
|
this._dirtyId++;
|
|
1247
1247
|
}
|
|
1248
|
-
},
|
|
1249
|
-
function
|
|
1250
|
-
let n =
|
|
1251
|
-
return n === void 0 && (
|
|
1248
|
+
}, Wt = Object.create(null), Gt = Object.create(null);
|
|
1249
|
+
function Kt(e, t) {
|
|
1250
|
+
let n = Gt[e];
|
|
1251
|
+
return n === void 0 && (Wt[t] === void 0 && (Wt[t] = 1), Gt[e] = n = Wt[t]++), n;
|
|
1252
1252
|
}
|
|
1253
1253
|
//#endregion
|
|
1254
1254
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1255
|
-
var
|
|
1255
|
+
var j = class extends e {
|
|
1256
1256
|
get _gl() {
|
|
1257
1257
|
return this._renderer.gl;
|
|
1258
1258
|
}
|
|
@@ -1266,7 +1266,7 @@ var A = class extends e {
|
|
|
1266
1266
|
_setup() {}
|
|
1267
1267
|
flush() {}
|
|
1268
1268
|
reset() {}
|
|
1269
|
-
},
|
|
1269
|
+
}, qt = class extends j {
|
|
1270
1270
|
install(e) {
|
|
1271
1271
|
super.install(e), e.buffer = this;
|
|
1272
1272
|
}
|
|
@@ -1276,8 +1276,8 @@ var A = class extends e {
|
|
|
1276
1276
|
return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
|
|
1277
1277
|
}
|
|
1278
1278
|
_createGlBuffer(e) {
|
|
1279
|
-
let t = this._gl, n = new
|
|
1280
|
-
return e.usage &
|
|
1279
|
+
let t = this._gl, n = new Bt(t.createBuffer()), r = zt.arrayBuffer;
|
|
1280
|
+
return e.usage & A.index ? r = zt.elementArrayBuffer : e.usage & A.uniform && (r = zt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1281
1281
|
switch (e) {
|
|
1282
1282
|
case "usage":
|
|
1283
1283
|
case "data":
|
|
@@ -1300,7 +1300,7 @@ var A = class extends e {
|
|
|
1300
1300
|
n.dirty = !1;
|
|
1301
1301
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1302
1302
|
r.bindBuffer(n.target, n.native);
|
|
1303
|
-
let o = i &
|
|
1303
|
+
let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1304
1304
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1305
1305
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1306
1306
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1315,13 +1315,13 @@ var A = class extends e {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
this.buffers.clear(), this.glBuffers.clear();
|
|
1317
1317
|
}
|
|
1318
|
-
},
|
|
1319
|
-
function
|
|
1320
|
-
return
|
|
1318
|
+
}, Jt;
|
|
1319
|
+
function Yt() {
|
|
1320
|
+
return Jt ||= "mediump", Jt;
|
|
1321
1321
|
}
|
|
1322
1322
|
//#endregion
|
|
1323
1323
|
//#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
|
|
1324
|
-
function
|
|
1324
|
+
function Xt(e, t, n) {
|
|
1325
1325
|
return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
|
|
1326
1326
|
#define in varying
|
|
1327
1327
|
#define finalColor gl_FragColor
|
|
@@ -1335,7 +1335,7 @@ ${e}`;
|
|
|
1335
1335
|
}
|
|
1336
1336
|
//#endregion
|
|
1337
1337
|
//#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
|
|
1338
|
-
function
|
|
1338
|
+
function Zt(e, t, n) {
|
|
1339
1339
|
let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
|
|
1340
1340
|
if (e.substring(0, 9) !== "precision") {
|
|
1341
1341
|
let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
|
|
@@ -1345,31 +1345,31 @@ function Qt(e, t, n) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
//#endregion
|
|
1347
1347
|
//#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
|
|
1348
|
-
function
|
|
1348
|
+
function Qt(e, t) {
|
|
1349
1349
|
return t ? `#version 300 es\n${e}` : e;
|
|
1350
1350
|
}
|
|
1351
1351
|
//#endregion
|
|
1352
1352
|
//#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
|
|
1353
|
-
var
|
|
1354
|
-
function
|
|
1353
|
+
var $t = {}, en = {};
|
|
1354
|
+
function tn(e, { name: t = "program" }, n = !0) {
|
|
1355
1355
|
t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
|
|
1356
|
-
let r = n ?
|
|
1356
|
+
let r = n ? $t : en;
|
|
1357
1357
|
return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
|
|
1358
1358
|
}
|
|
1359
1359
|
//#endregion
|
|
1360
1360
|
//#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
|
|
1361
|
-
function
|
|
1361
|
+
function nn(e, t) {
|
|
1362
1362
|
return t ? e.replace("#version 300 es", "") : e;
|
|
1363
1363
|
}
|
|
1364
1364
|
//#endregion
|
|
1365
1365
|
//#region src/core/renderers/gl/shader/GlProgram.ts
|
|
1366
|
-
var
|
|
1367
|
-
stripVersion:
|
|
1368
|
-
ensurePrecision:
|
|
1369
|
-
addProgramDefines:
|
|
1370
|
-
setProgramName:
|
|
1371
|
-
insertVersion:
|
|
1372
|
-
},
|
|
1366
|
+
var rn = Object.create(null), an = {
|
|
1367
|
+
stripVersion: nn,
|
|
1368
|
+
ensurePrecision: Zt,
|
|
1369
|
+
addProgramDefines: Xt,
|
|
1370
|
+
setProgramName: tn,
|
|
1371
|
+
insertVersion: Qt
|
|
1372
|
+
}, on = class e {
|
|
1373
1373
|
static defaultOptions = {
|
|
1374
1374
|
preferredVertexPrecision: "highp",
|
|
1375
1375
|
preferredFragmentPrecision: "mediump"
|
|
@@ -1392,25 +1392,25 @@ var an = Object.create(null), on = {
|
|
|
1392
1392
|
requestedFragmentPrecision: t.preferredFragmentPrecision,
|
|
1393
1393
|
requestedVertexPrecision: t.preferredVertexPrecision,
|
|
1394
1394
|
maxSupportedVertexPrecision: "highp",
|
|
1395
|
-
maxSupportedFragmentPrecision:
|
|
1395
|
+
maxSupportedFragmentPrecision: Yt()
|
|
1396
1396
|
},
|
|
1397
1397
|
setProgramName: { name: t.name },
|
|
1398
1398
|
addProgramDefines: i,
|
|
1399
1399
|
insertVersion: i
|
|
1400
1400
|
};
|
|
1401
|
-
Object.keys(
|
|
1401
|
+
Object.keys(an).forEach((e) => {
|
|
1402
1402
|
let t = a[e];
|
|
1403
|
-
n =
|
|
1404
|
-
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id =
|
|
1403
|
+
n = an[e](n, t, !0), r = an[e](r, t, !1);
|
|
1404
|
+
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Kt(`${r}:${n}`, "GlProgram");
|
|
1405
1405
|
}
|
|
1406
1406
|
destroy() {
|
|
1407
|
-
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete
|
|
1407
|
+
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete rn[this._cacheKey];
|
|
1408
1408
|
}
|
|
1409
1409
|
static from(t) {
|
|
1410
1410
|
let n = `${t.vertex}:${t.fragment}`;
|
|
1411
|
-
return
|
|
1411
|
+
return rn[n] || (rn[n] = new e(t), rn[n]._cacheKey = n), rn[n];
|
|
1412
1412
|
}
|
|
1413
|
-
},
|
|
1413
|
+
}, sn = {
|
|
1414
1414
|
uint8x2: {
|
|
1415
1415
|
size: 2,
|
|
1416
1416
|
stride: 2,
|
|
@@ -1562,19 +1562,19 @@ var an = Object.create(null), on = {
|
|
|
1562
1562
|
normalized: !1
|
|
1563
1563
|
}
|
|
1564
1564
|
};
|
|
1565
|
-
function
|
|
1566
|
-
return
|
|
1565
|
+
function cn(e) {
|
|
1566
|
+
return sn[e] ?? sn.float32;
|
|
1567
1567
|
}
|
|
1568
1568
|
//#endregion
|
|
1569
1569
|
//#region src/core/renderers/gl/shader/GlProgramData.ts
|
|
1570
|
-
var
|
|
1570
|
+
var ln = class {
|
|
1571
1571
|
native;
|
|
1572
1572
|
uniformDirtyGroups = Object.create(null);
|
|
1573
1573
|
uniforms = Object.create(null);
|
|
1574
1574
|
constructor(e) {
|
|
1575
1575
|
this.native = e;
|
|
1576
1576
|
}
|
|
1577
|
-
},
|
|
1577
|
+
}, un, dn = {
|
|
1578
1578
|
FLOAT: "float",
|
|
1579
1579
|
FLOAT_VEC2: "vec2",
|
|
1580
1580
|
FLOAT_VEC3: "vec3",
|
|
@@ -1603,7 +1603,7 @@ var un = class {
|
|
|
1603
1603
|
SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1604
1604
|
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1605
1605
|
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
1606
|
-
},
|
|
1606
|
+
}, fn = {
|
|
1607
1607
|
float: "float32",
|
|
1608
1608
|
vec2: "float32x2",
|
|
1609
1609
|
vec3: "float32x3",
|
|
@@ -1621,29 +1621,29 @@ var un = class {
|
|
|
1621
1621
|
bvec3: "uint32x3",
|
|
1622
1622
|
bvec4: "uint32x4"
|
|
1623
1623
|
};
|
|
1624
|
-
function
|
|
1625
|
-
if (!
|
|
1626
|
-
let t = Object.keys(
|
|
1627
|
-
|
|
1624
|
+
function pn(e, t) {
|
|
1625
|
+
if (!un) {
|
|
1626
|
+
let t = Object.keys(dn);
|
|
1627
|
+
un = {};
|
|
1628
1628
|
for (let n = 0; n < t.length; ++n) {
|
|
1629
1629
|
let r = t[n];
|
|
1630
|
-
|
|
1630
|
+
un[e[r]] = dn[r];
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
|
-
return
|
|
1633
|
+
return un[t];
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1636
|
-
return pn
|
|
1635
|
+
function mn(e, t) {
|
|
1636
|
+
return fn[pn(e, t)] || "float32";
|
|
1637
1637
|
}
|
|
1638
1638
|
//#endregion
|
|
1639
1639
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1640
|
-
var
|
|
1640
|
+
var hn = class extends j {
|
|
1641
1641
|
install(e) {
|
|
1642
1642
|
super.install(e), e.shader = this;
|
|
1643
1643
|
}
|
|
1644
1644
|
glProgramDatas = /* @__PURE__ */ new Map();
|
|
1645
1645
|
currentProgram = null;
|
|
1646
|
-
globalUniforms = new
|
|
1646
|
+
globalUniforms = new Ut({
|
|
1647
1647
|
projectionMatrix: new Float32Array([
|
|
1648
1648
|
1,
|
|
1649
1649
|
0,
|
|
@@ -1684,7 +1684,7 @@ var gn = class extends A {
|
|
|
1684
1684
|
return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
|
|
1685
1685
|
}
|
|
1686
1686
|
_createGlProgramData(e) {
|
|
1687
|
-
let t = this._gl, n = new
|
|
1687
|
+
let t = this._gl, n = new ln(t.createProgram());
|
|
1688
1688
|
this.glProgramDatas.set(e.id, n), this.useProgram(e);
|
|
1689
1689
|
let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
|
|
1690
1690
|
if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
|
|
@@ -1692,11 +1692,11 @@ var gn = class extends A {
|
|
|
1692
1692
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
|
|
1693
1693
|
let e = t.getActiveAttrib(n.native, r);
|
|
1694
1694
|
if (!e || e.name.startsWith("gl_")) continue;
|
|
1695
|
-
let i =
|
|
1695
|
+
let i = mn(t, e.type);
|
|
1696
1696
|
a[e.name] = {
|
|
1697
1697
|
location: 0,
|
|
1698
1698
|
format: i,
|
|
1699
|
-
stride:
|
|
1699
|
+
stride: cn(i).stride,
|
|
1700
1700
|
offset: 0,
|
|
1701
1701
|
instance: !1,
|
|
1702
1702
|
start: 0
|
|
@@ -1713,7 +1713,7 @@ var gn = class extends A {
|
|
|
1713
1713
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
|
|
1714
1714
|
let e = t.getActiveUniform(n.native, r);
|
|
1715
1715
|
if (!e) continue;
|
|
1716
|
-
let i = e.name.replace(/\[.*?\]$/, ""), a =
|
|
1716
|
+
let i = e.name.replace(/\[.*?\]$/, ""), a = pn(t, e.type), o = e.size;
|
|
1717
1717
|
c[i] = {
|
|
1718
1718
|
name: i,
|
|
1719
1719
|
index: r,
|
|
@@ -1748,7 +1748,7 @@ var gn = class extends A {
|
|
|
1748
1748
|
let { type: s, isArray: c, name: l } = o;
|
|
1749
1749
|
o.location === void 0 && (o.location = n.getUniformLocation(e.native, l));
|
|
1750
1750
|
let u = o.location;
|
|
1751
|
-
if (
|
|
1751
|
+
if (gn(o.value, a)) switch (o.value = _n(o.value, a), s) {
|
|
1752
1752
|
case "float":
|
|
1753
1753
|
c ? n.uniform1fv(u, a) : n.uniform1f(u, a);
|
|
1754
1754
|
break;
|
|
@@ -1835,7 +1835,7 @@ var gn = class extends A {
|
|
|
1835
1835
|
super.destroy(), this.bind(null);
|
|
1836
1836
|
}
|
|
1837
1837
|
};
|
|
1838
|
-
function
|
|
1838
|
+
function gn(e, t) {
|
|
1839
1839
|
if (typeof t == "object" && t) {
|
|
1840
1840
|
let n = t.length;
|
|
1841
1841
|
if (typeof e != "object" || !e || e.length !== n) return !0;
|
|
@@ -1844,7 +1844,7 @@ function _n(e, t) {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
return e !== t;
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function _n(e, t) {
|
|
1848
1848
|
if (typeof t == "object" && t) {
|
|
1849
1849
|
let n = t.length;
|
|
1850
1850
|
if (typeof e == "object" && e && e.length === n) {
|
|
@@ -1857,10 +1857,10 @@ function vn(e, t) {
|
|
|
1857
1857
|
}
|
|
1858
1858
|
//#endregion
|
|
1859
1859
|
//#region src/core/renderers/gl/state/GlBlendMode.ts
|
|
1860
|
-
var
|
|
1860
|
+
var vn = /* @__PURE__ */ function(e) {
|
|
1861
1861
|
return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
|
|
1862
1862
|
}({});
|
|
1863
|
-
function
|
|
1863
|
+
function yn(e) {
|
|
1864
1864
|
return {
|
|
1865
1865
|
normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
|
|
1866
1866
|
add: [e.ONE, e.ONE],
|
|
@@ -1915,7 +1915,7 @@ function bn(e) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
//#endregion
|
|
1917
1917
|
//#region src/core/renderers/gl/state/GlStateSystem.ts
|
|
1918
|
-
var
|
|
1918
|
+
var bn = class e {
|
|
1919
1919
|
static _properties = [
|
|
1920
1920
|
"blend",
|
|
1921
1921
|
"offsets",
|
|
@@ -1942,14 +1942,14 @@ var xn = class e {
|
|
|
1942
1942
|
let t = new e();
|
|
1943
1943
|
return t.depthTest = !1, t.blend = !0, t;
|
|
1944
1944
|
}
|
|
1945
|
-
_blendMode =
|
|
1945
|
+
_blendMode = vn.normal;
|
|
1946
1946
|
_polygonOffset = 0;
|
|
1947
1947
|
bitmap = 0;
|
|
1948
1948
|
get blendMode() {
|
|
1949
1949
|
return this._blendMode;
|
|
1950
1950
|
}
|
|
1951
1951
|
set blendMode(e) {
|
|
1952
|
-
this.blend = e !==
|
|
1952
|
+
this.blend = e !== vn.none, this._blendMode = e;
|
|
1953
1953
|
}
|
|
1954
1954
|
get polygonOffset() {
|
|
1955
1955
|
return this._polygonOffset;
|
|
@@ -1961,19 +1961,19 @@ var xn = class e {
|
|
|
1961
1961
|
if (e) for (let t in e) this[t] = e[t];
|
|
1962
1962
|
}
|
|
1963
1963
|
};
|
|
1964
|
-
|
|
1965
|
-
var
|
|
1964
|
+
bn._init();
|
|
1965
|
+
var xn = class extends j {
|
|
1966
1966
|
install(e) {
|
|
1967
1967
|
super.install(e), e.state = this;
|
|
1968
1968
|
}
|
|
1969
1969
|
_blendEq = !1;
|
|
1970
|
-
_setters =
|
|
1970
|
+
_setters = bn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
|
|
1971
1971
|
boundStateBitmap = 0;
|
|
1972
1972
|
boundBlendMode;
|
|
1973
1973
|
blendModes;
|
|
1974
|
-
defaultState = new
|
|
1974
|
+
defaultState = new bn({ blend: !0 });
|
|
1975
1975
|
_updateContext(e) {
|
|
1976
|
-
super._updateContext(e), this.blendModes =
|
|
1976
|
+
super._updateContext(e), this.blendModes = yn(e);
|
|
1977
1977
|
}
|
|
1978
1978
|
toggle(e, t) {
|
|
1979
1979
|
this._renderer.gl[t ? "enable" : "disable"](e);
|
|
@@ -2016,20 +2016,20 @@ var Sn = class extends A {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
reset() {
|
|
2018
2018
|
super.reset();
|
|
2019
|
-
let e = (1 <<
|
|
2019
|
+
let e = (1 << bn._properties.length) - 1;
|
|
2020
2020
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
2021
2021
|
}
|
|
2022
|
-
},
|
|
2022
|
+
}, Sn = 6, Cn = 64, wn = class extends j {
|
|
2023
2023
|
install(e) {
|
|
2024
2024
|
super.install(e), e.batch2D = this;
|
|
2025
2025
|
}
|
|
2026
|
-
_state =
|
|
2026
|
+
_state = bn.for2D();
|
|
2027
2027
|
_batchSize = 4096 * 4;
|
|
2028
2028
|
_batchables = [];
|
|
2029
2029
|
_vertexCount = 0;
|
|
2030
2030
|
_indexCount = 0;
|
|
2031
2031
|
_programs = /* @__PURE__ */ new Map();
|
|
2032
|
-
_effects = [
|
|
2032
|
+
_effects = [Lt, Rt];
|
|
2033
2033
|
_effectsRevision = 0;
|
|
2034
2034
|
effectUniforms = {};
|
|
2035
2035
|
registerEffect(e) {
|
|
@@ -2057,8 +2057,8 @@ var Sn = class extends A {
|
|
|
2057
2057
|
for (let e of r) Object.assign(o, e.uniformDefaults);
|
|
2058
2058
|
return {
|
|
2059
2059
|
shader: {
|
|
2060
|
-
instanceId:
|
|
2061
|
-
glProgram: new
|
|
2060
|
+
instanceId: mt(),
|
|
2061
|
+
glProgram: new on({
|
|
2062
2062
|
vertex: `${n}precision highp float;
|
|
2063
2063
|
in vec2 aPosition;
|
|
2064
2064
|
in vec2 aUv;
|
|
@@ -2141,18 +2141,18 @@ void main(void) {
|
|
|
2141
2141
|
};
|
|
2142
2142
|
}
|
|
2143
2143
|
_getSlot() {
|
|
2144
|
-
let e = Math.min(this._slotIndex++,
|
|
2144
|
+
let e = Math.min(this._slotIndex++, Cn - 1), t = this._slots[e];
|
|
2145
2145
|
if (!t) {
|
|
2146
2146
|
let n = {
|
|
2147
|
-
instanceId:
|
|
2148
|
-
usage:
|
|
2147
|
+
instanceId: mt(),
|
|
2148
|
+
usage: A.vertex,
|
|
2149
2149
|
data: /* @__PURE__ */ new Float32Array()
|
|
2150
2150
|
}, r = {
|
|
2151
|
-
instanceId:
|
|
2152
|
-
usage:
|
|
2151
|
+
instanceId: mt(),
|
|
2152
|
+
usage: A.index,
|
|
2153
2153
|
data: /* @__PURE__ */ new Uint32Array()
|
|
2154
2154
|
}, i = {
|
|
2155
|
-
instanceId:
|
|
2155
|
+
instanceId: mt(),
|
|
2156
2156
|
topology: "triangle-list",
|
|
2157
2157
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2158
2158
|
...t,
|
|
@@ -2186,7 +2186,7 @@ void main(void) {
|
|
|
2186
2186
|
let r = n[i], { start: a = 0, textures: o, textureLocationMap: s } = r;
|
|
2187
2187
|
for (let e = o.length, t = 0; t < e; t++) {
|
|
2188
2188
|
let e = o[t], n = s.get(e);
|
|
2189
|
-
n !== void 0 && this._renderer.texture.bind(e, n);
|
|
2189
|
+
n !== void 0 && this._renderer.texture.bind(e, n, r.textureClampMap.get(e));
|
|
2190
2190
|
}
|
|
2191
2191
|
this._state.blendMode = r.blendMode, this._renderer.state.bind(this._state), this._drawSlot(e, t, {
|
|
2192
2192
|
size: r.size,
|
|
@@ -2205,10 +2205,10 @@ void main(void) {
|
|
|
2205
2205
|
}
|
|
2206
2206
|
let e = this._vertexCount, t = this._indexCount, n = this._batchables;
|
|
2207
2207
|
this._batchables = [], this._vertexCount = 0, this._indexCount = 0;
|
|
2208
|
-
let r = this._renderer.texture.maxTextureImageUnits, i = this._getProgram(r), a = this._slotIndex >=
|
|
2209
|
-
if (l) for (let e = 0, t = 0, r = n.length; t < r; t++, e +=
|
|
2208
|
+
let r = this._renderer.texture.maxTextureImageUnits, i = this._getProgram(r), a = this._slotIndex >= Cn, o = this._getSlot(), s = this._effects.some((e) => e.name === "flowStreak" && e.uvNormalized), c = o.refs, l = !a && o.drawCalls.length > 0 && o.effectsRevision === this._effectsRevision && c.length === n.length * Sn;
|
|
2209
|
+
if (l) for (let e = 0, t = 0, r = n.length; t < r; t++, e += Sn) {
|
|
2210
2210
|
let r = n[t];
|
|
2211
|
-
if (c[e] !== (r.__source ?? r) || c[e + 1] !== r.texture || c[e + 2] !== r.uvs || c[e + 3] !== r.size || c[e + 4] !== r.roundPixels) {
|
|
2211
|
+
if (c[e] !== (r.__source ?? r) || c[e + 1] !== r.texture || c[e + 2] !== r.uvs || c[e + 3] !== r.size || c[e + 4] !== r.roundPixels || c[e + 5] !== r.clampTexture) {
|
|
2212
2212
|
l = !1;
|
|
2213
2213
|
break;
|
|
2214
2214
|
}
|
|
@@ -2219,45 +2219,47 @@ void main(void) {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
if (o.effectsRevision = this._effectsRevision, c.length = 0, !a) for (let e = n.length, t = 0; t < e; t++) {
|
|
2221
2221
|
let e = n[t];
|
|
2222
|
-
c.push(e.__source ?? e, e.texture, e.uvs, e.size, e.roundPixels);
|
|
2222
|
+
c.push(e.__source ?? e, e.texture, e.uvs, e.size, e.roundPixels, e.clampTexture);
|
|
2223
2223
|
}
|
|
2224
2224
|
let u = e * this._vertexSize * 4;
|
|
2225
|
-
(!o.attrData || o.attrData.byteLength < u) && (o.attrData = new ArrayBuffer(
|
|
2225
|
+
(!o.attrData || o.attrData.byteLength < u) && (o.attrData = new ArrayBuffer(Tn(u)), o.f32 = new Float32Array(o.attrData), o.u8 = new Uint8Array(o.attrData)), (!o.indexData || o.indexData.length < t) && (o.indexData = new Uint32Array(Tn(t)));
|
|
2226
2226
|
let d = o.f32, f = o.u8, p = o.indexData, m = 0, h = 0, g = [], ee = 0;
|
|
2227
|
-
for (let e = n.length, t = { id: ++ee }, i = [], a = /* @__PURE__ */ new Map(), o =
|
|
2228
|
-
let
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2227
|
+
for (let e = n.length, t = { id: ++ee }, i = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), c = 0, l = 0, u = 0; u < e; u++) {
|
|
2228
|
+
let e = n[u].texture, te = !!n[u].clampTexture;
|
|
2229
|
+
e && o.set(e, te);
|
|
2230
|
+
let ne = n[u + 1], re = !ne || !!ne.texture && o.has(ne.texture) && o.get(ne.texture) !== !!ne.clampTexture;
|
|
2231
|
+
if (!e || a.has(e)) {
|
|
2232
|
+
if (!re) continue;
|
|
2233
|
+
} else i.push(e), a.set(e, c++);
|
|
2234
|
+
if (re || c >= r) {
|
|
2235
|
+
t.textures = i, t.textureClampMap = o, t.textureLocationMap = a, c = 0, t.start = h;
|
|
2236
|
+
for (let e = l; e <= u; e++) {
|
|
2237
|
+
let { indices: r, vertices: o, uvs: c = /* @__PURE__ */ new Float32Array(), size: u = {
|
|
2236
2238
|
width: 0,
|
|
2237
2239
|
height: 0
|
|
2238
|
-
}, texture: te, blendMode: ne =
|
|
2240
|
+
}, texture: te, blendMode: ne = vn.normal, clipOutsideUv: re, roundPixels: ie, modulate: ae = [
|
|
2239
2241
|
255,
|
|
2240
2242
|
255,
|
|
2241
2243
|
255,
|
|
2242
2244
|
255
|
|
2243
2245
|
], effectFlags: oe, effectParam: se } = n[e];
|
|
2244
|
-
|
|
2246
|
+
l < e && t.blendMode !== ne && (t.size = h - t.start, g.push(t), l = e, t = { id: ++ee }, t.textures = i, t.textureLocationMap = a, t.start = h);
|
|
2245
2247
|
let { width: _, height: ce } = u, le = m / this._vertexSize, ue = (te ? a.get(te) : 255) ?? 255, de = +!!ie, fe = +!!re | (oe ?? 0), v = se ?? 0, y = 0, pe = de;
|
|
2246
2248
|
if (se) {
|
|
2247
2249
|
let t = 0;
|
|
2248
|
-
for (let e = 0, n =
|
|
2250
|
+
for (let e = 0, n = c.length; e < n; e += 2) c[e] > t && (t = c[e]);
|
|
2249
2251
|
if (t > 0) {
|
|
2250
2252
|
s && (y = 1 / t);
|
|
2251
2253
|
let r = n[e].lineStyle?.width ?? 0;
|
|
2252
2254
|
pe = de | Math.max(0, Math.min(127, Math.round(r / t / .6 * 127))) << 1;
|
|
2253
2255
|
}
|
|
2254
2256
|
}
|
|
2255
|
-
let me, he,
|
|
2256
|
-
for (let e = o.length, t = 0; t < e; t += 2) me =
|
|
2257
|
+
let me, he, b;
|
|
2258
|
+
for (let e = o.length, t = 0; t < e; t += 2) me = c[t], he = c[t + 1], _ > 0 && ce > 0 && (me = Math.ceil(me * _) / _, he = Math.ceil(he * ce) / ce), y && (me *= y), d[m++] = o[t], d[m++] = o[t + 1], d[m++] = me, d[m++] = he, b = m * 4, f[b] = ue, f[b + 1] = fe, f[b + 2] = pe, f[b + 3] = v, m++, b = m * 4, f[b] = ae[0], f[b + 1] = ae[1], f[b + 2] = ae[2], f[b + 3] = ae[3], m++;
|
|
2257
2259
|
for (let e = r.length, t = 0; t < e; t++) p[h++] = le + r[t];
|
|
2258
2260
|
t.blendMode = ne;
|
|
2259
2261
|
}
|
|
2260
|
-
|
|
2262
|
+
l = u + 1, t.size = h - t.start, g.push(t), t = { id: ++ee }, i = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
2261
2263
|
}
|
|
2262
2264
|
}
|
|
2263
2265
|
this._renderer.geometry.unbind(), o.buffer.data = d.subarray(0, e * this._vertexSize), o.indexBuffer.data = p.subarray(0, t), this._renderer.buffer.update(o.buffer, !0), this._renderer.buffer.update(o.indexBuffer, !0), o.drawCalls = g, this._issueDrawCalls(i, o);
|
|
@@ -2266,10 +2268,10 @@ void main(void) {
|
|
|
2266
2268
|
super.reset(), this._slots = [], this._slotIndex = 0, this._batchables = [], this._vertexCount = 0, this._indexCount = 0;
|
|
2267
2269
|
}
|
|
2268
2270
|
};
|
|
2269
|
-
function
|
|
2271
|
+
function Tn(e) {
|
|
2270
2272
|
return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
|
|
2271
2273
|
}
|
|
2272
|
-
function
|
|
2274
|
+
function En(e) {
|
|
2273
2275
|
let t = (e > 65535) << 4;
|
|
2274
2276
|
e >>>= t;
|
|
2275
2277
|
let n = (e > 255) << 3;
|
|
@@ -2277,11 +2279,11 @@ function Dn(e) {
|
|
|
2277
2279
|
}
|
|
2278
2280
|
//#endregion
|
|
2279
2281
|
//#region src/core/renderers/gl/const.ts
|
|
2280
|
-
var
|
|
2282
|
+
var M = /* @__PURE__ */ function(e) {
|
|
2281
2283
|
return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
|
|
2282
|
-
}({}),
|
|
2284
|
+
}({}), Dn = /* @__PURE__ */ function(e) {
|
|
2283
2285
|
return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
|
|
2284
|
-
}({}),
|
|
2286
|
+
}({}), On = class extends j {
|
|
2285
2287
|
install(e) {
|
|
2286
2288
|
super.install(e), e.mask = this;
|
|
2287
2289
|
}
|
|
@@ -2300,16 +2302,16 @@ var j = /* @__PURE__ */ function(e) {
|
|
|
2300
2302
|
};
|
|
2301
2303
|
this.stack.push(n);
|
|
2302
2304
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2303
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2305
|
+
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2304
2306
|
}
|
|
2305
2307
|
pop(e) {
|
|
2306
2308
|
let t = this.stack.pop();
|
|
2307
2309
|
if (!t || t.source !== e) return;
|
|
2308
2310
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2309
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(
|
|
2311
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(Dn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2310
2312
|
}
|
|
2311
|
-
},
|
|
2312
|
-
|
|
2313
|
+
}, kn = [];
|
|
2314
|
+
kn[M.none] = {}, kn[M.disabled] = {}, kn[M.renderingMaskAdd] = {
|
|
2313
2315
|
stencilFront: {
|
|
2314
2316
|
compare: "equal",
|
|
2315
2317
|
passOp: "increment-clamp"
|
|
@@ -2318,7 +2320,7 @@ An[j.none] = {}, An[j.disabled] = {}, An[j.renderingMaskAdd] = {
|
|
|
2318
2320
|
compare: "equal",
|
|
2319
2321
|
passOp: "increment-clamp"
|
|
2320
2322
|
}
|
|
2321
|
-
},
|
|
2323
|
+
}, kn[M.renderingMaskRemove] = {
|
|
2322
2324
|
stencilFront: {
|
|
2323
2325
|
compare: "equal",
|
|
2324
2326
|
passOp: "decrement-clamp"
|
|
@@ -2327,7 +2329,7 @@ An[j.none] = {}, An[j.disabled] = {}, An[j.renderingMaskAdd] = {
|
|
|
2327
2329
|
compare: "equal",
|
|
2328
2330
|
passOp: "decrement-clamp"
|
|
2329
2331
|
}
|
|
2330
|
-
},
|
|
2332
|
+
}, kn[M.maskActive] = {
|
|
2331
2333
|
stencilFront: {
|
|
2332
2334
|
compare: "equal",
|
|
2333
2335
|
passOp: "keep"
|
|
@@ -2336,7 +2338,7 @@ An[j.none] = {}, An[j.disabled] = {}, An[j.renderingMaskAdd] = {
|
|
|
2336
2338
|
compare: "equal",
|
|
2337
2339
|
passOp: "keep"
|
|
2338
2340
|
}
|
|
2339
|
-
},
|
|
2341
|
+
}, kn[M.inverseMaskActive] = {
|
|
2340
2342
|
stencilFront: {
|
|
2341
2343
|
compare: "not-equal",
|
|
2342
2344
|
passOp: "keep"
|
|
@@ -2346,17 +2348,17 @@ An[j.none] = {}, An[j.disabled] = {}, An[j.renderingMaskAdd] = {
|
|
|
2346
2348
|
passOp: "keep"
|
|
2347
2349
|
}
|
|
2348
2350
|
};
|
|
2349
|
-
var
|
|
2351
|
+
var An = class extends j {
|
|
2350
2352
|
install(e) {
|
|
2351
2353
|
super.install(e), e.stencil = this;
|
|
2352
2354
|
}
|
|
2353
2355
|
_cache = {
|
|
2354
2356
|
enabled: !1,
|
|
2355
|
-
stencilMode:
|
|
2357
|
+
stencilMode: M.none,
|
|
2356
2358
|
refCount: 0
|
|
2357
2359
|
};
|
|
2358
2360
|
current = { [-1]: {
|
|
2359
|
-
stencilMode:
|
|
2361
|
+
stencilMode: M.disabled,
|
|
2360
2362
|
refCount: 0
|
|
2361
2363
|
} };
|
|
2362
2364
|
_passOpMap;
|
|
@@ -2386,20 +2388,20 @@ var jn = class extends A {
|
|
|
2386
2388
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2387
2389
|
}
|
|
2388
2390
|
reset() {
|
|
2389
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2391
|
+
this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
|
|
2390
2392
|
}
|
|
2391
2393
|
_updateRenderTarget = (e) => {
|
|
2392
2394
|
if (e) {
|
|
2393
2395
|
let t = this.current[e.instanceId];
|
|
2394
2396
|
t ||= this.current[e.instanceId] = {
|
|
2395
|
-
stencilMode:
|
|
2397
|
+
stencilMode: M.disabled,
|
|
2396
2398
|
refCount: 0
|
|
2397
2399
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2398
2400
|
}
|
|
2399
2401
|
};
|
|
2400
2402
|
bind(e, t) {
|
|
2401
|
-
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i =
|
|
2402
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2403
|
+
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = kn[e], a = this._cache;
|
|
2404
|
+
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2403
2405
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2404
2406
|
return;
|
|
2405
2407
|
}
|
|
@@ -2408,8 +2410,8 @@ var jn = class extends A {
|
|
|
2408
2410
|
destroy() {
|
|
2409
2411
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2410
2412
|
}
|
|
2411
|
-
},
|
|
2412
|
-
current = new
|
|
2413
|
+
}, jn = class extends j {
|
|
2414
|
+
current = new Tt(0, 0, 0, 0);
|
|
2413
2415
|
install(e) {
|
|
2414
2416
|
super.install(e), e.viewport = this;
|
|
2415
2417
|
}
|
|
@@ -2417,7 +2419,7 @@ var jn = class extends A {
|
|
|
2417
2419
|
let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
|
|
2418
2420
|
t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
|
|
2419
2421
|
}
|
|
2420
|
-
},
|
|
2422
|
+
}, Mn = class {
|
|
2421
2423
|
framebuffer;
|
|
2422
2424
|
width = -1;
|
|
2423
2425
|
height = -1;
|
|
@@ -2428,7 +2430,7 @@ var jn = class extends A {
|
|
|
2428
2430
|
constructor(e) {
|
|
2429
2431
|
this.framebuffer = e;
|
|
2430
2432
|
}
|
|
2431
|
-
},
|
|
2433
|
+
}, Nn = class extends j {
|
|
2432
2434
|
install(e) {
|
|
2433
2435
|
super.install(e), e.renderTarget = this;
|
|
2434
2436
|
}
|
|
@@ -2438,7 +2440,7 @@ var jn = class extends A {
|
|
|
2438
2440
|
_msaaSamples = [];
|
|
2439
2441
|
_hasMRT = !0;
|
|
2440
2442
|
_writeDepthTexture = !0;
|
|
2441
|
-
projection = new
|
|
2443
|
+
projection = new At();
|
|
2442
2444
|
get _sampleCount() {
|
|
2443
2445
|
return Math.min(4, this._msaaSamples[0] || 4);
|
|
2444
2446
|
}
|
|
@@ -2477,7 +2479,7 @@ var jn = class extends A {
|
|
|
2477
2479
|
return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
|
|
2478
2480
|
}
|
|
2479
2481
|
_createGlRenderTarget(e) {
|
|
2480
|
-
let t = this._gl, n = new
|
|
2482
|
+
let t = this._gl, n = new Mn(t.createFramebuffer());
|
|
2481
2483
|
return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
|
|
2482
2484
|
switch (t) {
|
|
2483
2485
|
case "width":
|
|
@@ -2554,28 +2556,29 @@ var jn = class extends A {
|
|
|
2554
2556
|
reset() {
|
|
2555
2557
|
super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
|
|
2556
2558
|
}
|
|
2557
|
-
},
|
|
2559
|
+
}, Pn = /* @__PURE__ */ function(e) {
|
|
2558
2560
|
return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
|
|
2559
|
-
}({}),
|
|
2561
|
+
}({}), Fn = /* @__PURE__ */ function(e) {
|
|
2560
2562
|
return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
|
|
2561
|
-
}({}),
|
|
2563
|
+
}({}), N = /* @__PURE__ */ function(e) {
|
|
2562
2564
|
return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
|
|
2563
|
-
}({}),
|
|
2565
|
+
}({}), In = class {
|
|
2564
2566
|
native;
|
|
2565
|
-
target =
|
|
2567
|
+
target = Fn.TEXTURE_2D;
|
|
2566
2568
|
width = -1;
|
|
2567
2569
|
height = -1;
|
|
2568
2570
|
mipmap = !1;
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2571
|
+
clampOverride = !1;
|
|
2572
|
+
type = N.UNSIGNED_BYTE;
|
|
2573
|
+
internalFormat = Pn.RGBA;
|
|
2574
|
+
format = Pn.RGBA;
|
|
2572
2575
|
constructor(e) {
|
|
2573
2576
|
this.native = e;
|
|
2574
2577
|
}
|
|
2575
2578
|
};
|
|
2576
2579
|
//#endregion
|
|
2577
2580
|
//#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
|
|
2578
|
-
function
|
|
2581
|
+
function Ln(e) {
|
|
2579
2582
|
return {
|
|
2580
2583
|
r8unorm: e.RED,
|
|
2581
2584
|
r8snorm: e.RED,
|
|
@@ -2623,7 +2626,7 @@ function Rn(e) {
|
|
|
2623
2626
|
}
|
|
2624
2627
|
//#endregion
|
|
2625
2628
|
//#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
|
|
2626
|
-
function
|
|
2629
|
+
function Rn(e, t) {
|
|
2627
2630
|
let n = {}, r = e.RGBA;
|
|
2628
2631
|
return e instanceof WebGLRenderingContext ? t.srgb && (n = {
|
|
2629
2632
|
"rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
|
|
@@ -2739,7 +2742,7 @@ function zn(e, t) {
|
|
|
2739
2742
|
}
|
|
2740
2743
|
//#endregion
|
|
2741
2744
|
//#region src/core/renderers/gl/texture/mapFormatToGlType.ts
|
|
2742
|
-
function
|
|
2745
|
+
function zn(e) {
|
|
2743
2746
|
return {
|
|
2744
2747
|
r8unorm: e.UNSIGNED_BYTE,
|
|
2745
2748
|
r8snorm: e.BYTE,
|
|
@@ -2787,7 +2790,7 @@ function Bn(e) {
|
|
|
2787
2790
|
}
|
|
2788
2791
|
//#endregion
|
|
2789
2792
|
//#region src/core/renderers/gl/texture/updateTextureStyle.ts
|
|
2790
|
-
var
|
|
2793
|
+
var Bn = {
|
|
2791
2794
|
linear: {
|
|
2792
2795
|
linear: 9987,
|
|
2793
2796
|
nearest: 9985
|
|
@@ -2796,10 +2799,10 @@ var Vn = {
|
|
|
2796
2799
|
linear: 9986,
|
|
2797
2800
|
nearest: 9984
|
|
2798
2801
|
}
|
|
2799
|
-
},
|
|
2802
|
+
}, Vn = {
|
|
2800
2803
|
linear: 9729,
|
|
2801
2804
|
nearest: 9728
|
|
2802
|
-
},
|
|
2805
|
+
}, Hn = {
|
|
2803
2806
|
never: 512,
|
|
2804
2807
|
less: 513,
|
|
2805
2808
|
equal: 514,
|
|
@@ -2808,32 +2811,32 @@ var Vn = {
|
|
|
2808
2811
|
"not-equal": 517,
|
|
2809
2812
|
"greater-equal": 518,
|
|
2810
2813
|
always: 519
|
|
2811
|
-
},
|
|
2814
|
+
}, Un = {
|
|
2812
2815
|
"clamp-to-edge": 33071,
|
|
2813
2816
|
repeat: 10497,
|
|
2814
2817
|
"mirror-repeat": 33648
|
|
2815
2818
|
};
|
|
2816
|
-
function
|
|
2819
|
+
function Wn(e, t, n, r, i, a, o, s) {
|
|
2817
2820
|
let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
|
|
2818
2821
|
if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
|
|
2819
|
-
let e =
|
|
2822
|
+
let e = Un[o ? "clamp-to-edge" : c], n = Un[o ? "clamp-to-edge" : l], r = Un[o ? "clamp-to-edge" : u];
|
|
2820
2823
|
t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
|
|
2821
2824
|
}
|
|
2822
|
-
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER,
|
|
2825
|
+
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, Vn[d]), n) {
|
|
2823
2826
|
if (!s || p !== "linear") {
|
|
2824
|
-
let e =
|
|
2827
|
+
let e = Bn[f][p];
|
|
2825
2828
|
t[i](g, t.TEXTURE_MIN_FILTER, e);
|
|
2826
2829
|
}
|
|
2827
|
-
} else t[i](g, t.TEXTURE_MIN_FILTER,
|
|
2830
|
+
} else t[i](g, t.TEXTURE_MIN_FILTER, Vn[f]);
|
|
2828
2831
|
if (r && m > 1) {
|
|
2829
2832
|
let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
2830
2833
|
t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
|
|
2831
2834
|
}
|
|
2832
|
-
h && t[i](g, t.TEXTURE_COMPARE_FUNC,
|
|
2835
|
+
h && t[i](g, t.TEXTURE_COMPARE_FUNC, Hn[h]);
|
|
2833
2836
|
}
|
|
2834
2837
|
//#endregion
|
|
2835
2838
|
//#region src/core/renderers/gl/texture/uploaders/index.ts
|
|
2836
|
-
var
|
|
2839
|
+
var Gn = {
|
|
2837
2840
|
buffer: {
|
|
2838
2841
|
id: "buffer",
|
|
2839
2842
|
upload: (e, t, n) => {
|
|
@@ -2847,8 +2850,8 @@ var Kn = {
|
|
|
2847
2850
|
c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
|
|
2848
2851
|
}
|
|
2849
2852
|
}
|
|
2850
|
-
},
|
|
2851
|
-
uploaders = { ...
|
|
2853
|
+
}, Kn = class extends j {
|
|
2854
|
+
uploaders = { ...Gn };
|
|
2852
2855
|
textures = /* @__PURE__ */ new Map();
|
|
2853
2856
|
glTextures = /* @__PURE__ */ new Map();
|
|
2854
2857
|
_mapFormatToInternalFormat = Object.create(null);
|
|
@@ -2863,14 +2866,14 @@ var Kn = {
|
|
|
2863
2866
|
super.install(e), e.texture = this;
|
|
2864
2867
|
}
|
|
2865
2868
|
_updateContext(e) {
|
|
2866
|
-
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat =
|
|
2869
|
+
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = Rn(e, this._renderer.extensions), this._mapFormatToType = zn(e), this._mapFormatToFormat = Ln(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
|
|
2867
2870
|
for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
|
|
2868
2871
|
}
|
|
2869
2872
|
getGlTexture(e) {
|
|
2870
2873
|
return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
|
|
2871
2874
|
}
|
|
2872
2875
|
_createGlTexture(e) {
|
|
2873
|
-
let t = this._gl, n = new
|
|
2876
|
+
let t = this._gl, n = new In(t.createTexture());
|
|
2874
2877
|
if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
|
|
2875
2878
|
let t = Math.max(e.pixelWidth ?? e.width, e.pixelHeight ?? e.height);
|
|
2876
2879
|
e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
|
|
@@ -2903,12 +2906,20 @@ var Kn = {
|
|
|
2903
2906
|
this.textures.delete(e.instanceId), this._sourceUnload(e);
|
|
2904
2907
|
})), this.textures.set(e.instanceId, e)), this.updateGpuTexture(e), this.updateStyle(e), n;
|
|
2905
2908
|
}
|
|
2906
|
-
bind(e, t = this._location) {
|
|
2907
|
-
let
|
|
2908
|
-
if (this.current[t] !==
|
|
2909
|
-
let e = this.getGlTexture(
|
|
2910
|
-
|
|
2911
|
-
} else
|
|
2909
|
+
bind(e, t = this._location, n = !1) {
|
|
2910
|
+
let r = this._gl, i = e ?? null;
|
|
2911
|
+
if (this.current[t] !== i) if (this.current[t] = i, this._activateLocation(t), i) {
|
|
2912
|
+
let e = this.getGlTexture(i);
|
|
2913
|
+
r.bindTexture(e.target, e.native);
|
|
2914
|
+
} else r.bindTexture(r.TEXTURE_2D, null);
|
|
2915
|
+
if (i) {
|
|
2916
|
+
let e = this.getGlTexture(i);
|
|
2917
|
+
if (e.clampOverride !== n) {
|
|
2918
|
+
this._activateLocation(t);
|
|
2919
|
+
let a = n || !this._renderer.supports.nonPowOf2wrapping && !i.isPowerOfTwo;
|
|
2920
|
+
r.texParameteri(e.target, r.TEXTURE_WRAP_S, Un[a ? "clamp-to-edge" : i.addressModeU ?? "repeat"]), r.texParameteri(e.target, r.TEXTURE_WRAP_T, Un[a ? "clamp-to-edge" : i.addressModeV ?? "repeat"]), e.clampOverride = n;
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2912
2923
|
}
|
|
2913
2924
|
_activateLocation(e) {
|
|
2914
2925
|
if (this._location !== e) {
|
|
@@ -2929,8 +2940,9 @@ var Kn = {
|
|
|
2929
2940
|
n && (this.unbind(e), this.glTextures.delete(e.instanceId), t.deleteTexture(n.native));
|
|
2930
2941
|
}
|
|
2931
2942
|
updateStyle(e, t = !1) {
|
|
2943
|
+
this.bind(e);
|
|
2932
2944
|
let n = this._gl;
|
|
2933
|
-
|
|
2945
|
+
Wn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
|
|
2934
2946
|
}
|
|
2935
2947
|
updateGpuTexture(e) {
|
|
2936
2948
|
this.bind(e);
|
|
@@ -2945,50 +2957,50 @@ var Kn = {
|
|
|
2945
2957
|
let e = this._gl;
|
|
2946
2958
|
this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
|
|
2947
2959
|
}
|
|
2948
|
-
},
|
|
2949
|
-
uint8x2:
|
|
2950
|
-
uint8x4:
|
|
2951
|
-
sint8x2:
|
|
2952
|
-
sint8x4:
|
|
2953
|
-
unorm8x2:
|
|
2954
|
-
unorm8x4:
|
|
2955
|
-
snorm8x2:
|
|
2956
|
-
snorm8x4:
|
|
2957
|
-
uint16x2:
|
|
2958
|
-
uint16x4:
|
|
2959
|
-
sint16x2:
|
|
2960
|
-
sint16x4:
|
|
2961
|
-
unorm16x2:
|
|
2962
|
-
unorm16x4:
|
|
2963
|
-
snorm16x2:
|
|
2964
|
-
snorm16x4:
|
|
2965
|
-
float16x2:
|
|
2966
|
-
float16x4:
|
|
2967
|
-
float32:
|
|
2968
|
-
float32x2:
|
|
2969
|
-
float32x3:
|
|
2970
|
-
float32x4:
|
|
2971
|
-
uint32:
|
|
2972
|
-
uint32x2:
|
|
2973
|
-
uint32x3:
|
|
2974
|
-
uint32x4:
|
|
2975
|
-
sint32:
|
|
2976
|
-
sint32x2:
|
|
2977
|
-
sint32x3:
|
|
2978
|
-
sint32x4:
|
|
2960
|
+
}, qn = {
|
|
2961
|
+
uint8x2: N.UNSIGNED_BYTE,
|
|
2962
|
+
uint8x4: N.UNSIGNED_BYTE,
|
|
2963
|
+
sint8x2: N.BYTE,
|
|
2964
|
+
sint8x4: N.BYTE,
|
|
2965
|
+
unorm8x2: N.UNSIGNED_BYTE,
|
|
2966
|
+
unorm8x4: N.UNSIGNED_BYTE,
|
|
2967
|
+
snorm8x2: N.BYTE,
|
|
2968
|
+
snorm8x4: N.BYTE,
|
|
2969
|
+
uint16x2: N.UNSIGNED_SHORT,
|
|
2970
|
+
uint16x4: N.UNSIGNED_SHORT,
|
|
2971
|
+
sint16x2: N.SHORT,
|
|
2972
|
+
sint16x4: N.SHORT,
|
|
2973
|
+
unorm16x2: N.UNSIGNED_SHORT,
|
|
2974
|
+
unorm16x4: N.UNSIGNED_SHORT,
|
|
2975
|
+
snorm16x2: N.SHORT,
|
|
2976
|
+
snorm16x4: N.SHORT,
|
|
2977
|
+
float16x2: N.HALF_FLOAT,
|
|
2978
|
+
float16x4: N.HALF_FLOAT,
|
|
2979
|
+
float32: N.FLOAT,
|
|
2980
|
+
float32x2: N.FLOAT,
|
|
2981
|
+
float32x3: N.FLOAT,
|
|
2982
|
+
float32x4: N.FLOAT,
|
|
2983
|
+
uint32: N.UNSIGNED_INT,
|
|
2984
|
+
uint32x2: N.UNSIGNED_INT,
|
|
2985
|
+
uint32x3: N.UNSIGNED_INT,
|
|
2986
|
+
uint32x4: N.UNSIGNED_INT,
|
|
2987
|
+
sint32: N.INT,
|
|
2988
|
+
sint32x2: N.INT,
|
|
2989
|
+
sint32x3: N.INT,
|
|
2990
|
+
sint32x4: N.INT
|
|
2979
2991
|
};
|
|
2980
|
-
function
|
|
2981
|
-
return
|
|
2992
|
+
function Jn(e) {
|
|
2993
|
+
return qn[e] ?? qn.float32;
|
|
2982
2994
|
}
|
|
2983
2995
|
//#endregion
|
|
2984
2996
|
//#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
|
|
2985
|
-
var
|
|
2997
|
+
var Yn = {
|
|
2986
2998
|
"point-list": 0,
|
|
2987
2999
|
"line-list": 1,
|
|
2988
3000
|
"line-strip": 3,
|
|
2989
3001
|
"triangle-list": 4,
|
|
2990
3002
|
"triangle-strip": 5
|
|
2991
|
-
},
|
|
3003
|
+
}, Xn = class extends j {
|
|
2992
3004
|
_geometryVaoHash = {};
|
|
2993
3005
|
hasInstance = !1;
|
|
2994
3006
|
current = null;
|
|
@@ -3027,11 +3039,11 @@ var Xn = {
|
|
|
3027
3039
|
}
|
|
3028
3040
|
for (let e in r) {
|
|
3029
3041
|
let t = r[e];
|
|
3030
|
-
i[t.buffer.instanceId] +=
|
|
3042
|
+
i[t.buffer.instanceId] += cn(t.format).stride;
|
|
3031
3043
|
}
|
|
3032
3044
|
for (let e in r) {
|
|
3033
3045
|
let t = r[e];
|
|
3034
|
-
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] +=
|
|
3046
|
+
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += cn(t.format).stride;
|
|
3035
3047
|
}
|
|
3036
3048
|
}
|
|
3037
3049
|
_createVao(e, t) {
|
|
@@ -3066,7 +3078,7 @@ var Xn = {
|
|
|
3066
3078
|
a !== c && (r.bind(s), a = c);
|
|
3067
3079
|
let e = l.location;
|
|
3068
3080
|
n.enableVertexAttribArray(e);
|
|
3069
|
-
let t =
|
|
3081
|
+
let t = cn(o.format), i = Jn(o.format);
|
|
3070
3082
|
if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
|
|
3071
3083
|
let t = o.divisor ?? 1;
|
|
3072
3084
|
n.vertexAttribDivisor(e, t);
|
|
@@ -3099,7 +3111,7 @@ var Xn = {
|
|
|
3099
3111
|
let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
|
|
3100
3112
|
if (!o) return this;
|
|
3101
3113
|
t = t || o.topology || "triangle-list";
|
|
3102
|
-
let s =
|
|
3114
|
+
let s = Yn[t];
|
|
3103
3115
|
if (i = i || o.instanceCount || 1, o.indexBuffer) {
|
|
3104
3116
|
n ||= o.indexBuffer.data.length;
|
|
3105
3117
|
let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
|
|
@@ -3120,7 +3132,7 @@ var Xn = {
|
|
|
3120
3132
|
}
|
|
3121
3133
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
3122
3134
|
}
|
|
3123
|
-
},
|
|
3135
|
+
}, Zn = class extends j {
|
|
3124
3136
|
install(e) {
|
|
3125
3137
|
super.install(e), e.colorMask = this;
|
|
3126
3138
|
}
|
|
@@ -3131,19 +3143,19 @@ var Xn = {
|
|
|
3131
3143
|
};
|
|
3132
3144
|
//#endregion
|
|
3133
3145
|
//#region src/core/renderers/gl/GlScissorSystem.ts
|
|
3134
|
-
function
|
|
3146
|
+
function Qn(e, t, n) {
|
|
3135
3147
|
let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
|
|
3136
3148
|
return {
|
|
3137
3149
|
x: f / m,
|
|
3138
3150
|
y: p / m
|
|
3139
3151
|
};
|
|
3140
3152
|
}
|
|
3141
|
-
function
|
|
3153
|
+
function $n(e, t) {
|
|
3142
3154
|
let { x: n, y: r, width: i, height: a } = t, o = [
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3155
|
+
Qn(e, n, r),
|
|
3156
|
+
Qn(e, n + i, r),
|
|
3157
|
+
Qn(e, n + i, r + a),
|
|
3158
|
+
Qn(e, n, r + a)
|
|
3147
3159
|
], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
|
|
3148
3160
|
return {
|
|
3149
3161
|
x: l,
|
|
@@ -3152,7 +3164,7 @@ function er(e, t) {
|
|
|
3152
3164
|
height: f - d
|
|
3153
3165
|
};
|
|
3154
3166
|
}
|
|
3155
|
-
function
|
|
3167
|
+
function er(e, t) {
|
|
3156
3168
|
let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
|
|
3157
3169
|
return {
|
|
3158
3170
|
x: n,
|
|
@@ -3161,7 +3173,7 @@ function tr(e, t) {
|
|
|
3161
3173
|
height: Math.max(0, a - r)
|
|
3162
3174
|
};
|
|
3163
3175
|
}
|
|
3164
|
-
var
|
|
3176
|
+
var tr = class extends j {
|
|
3165
3177
|
install(e) {
|
|
3166
3178
|
super.install(e), e.scissor = this;
|
|
3167
3179
|
}
|
|
@@ -3185,7 +3197,7 @@ var nr = class extends A {
|
|
|
3185
3197
|
y: e.y,
|
|
3186
3198
|
width: e.width,
|
|
3187
3199
|
height: e.height
|
|
3188
|
-
}, i = n ?
|
|
3200
|
+
}, i = n ? er(n, r) : r;
|
|
3189
3201
|
t.stack.push(i), this.bind(i);
|
|
3190
3202
|
}
|
|
3191
3203
|
pop() {
|
|
@@ -3196,28 +3208,28 @@ var nr = class extends A {
|
|
|
3196
3208
|
let t = this._gl;
|
|
3197
3209
|
if (e) {
|
|
3198
3210
|
t.enable(t.SCISSOR_TEST);
|
|
3199
|
-
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } =
|
|
3211
|
+
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = $n(i, e), l = r.current.height / n - (o + c);
|
|
3200
3212
|
t.scissor(a * n, l * n, s * n, c * n);
|
|
3201
3213
|
} else t.disable(t.SCISSOR_TEST);
|
|
3202
3214
|
}
|
|
3203
3215
|
destroy() {
|
|
3204
3216
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
3205
3217
|
}
|
|
3206
|
-
},
|
|
3218
|
+
}, nr = class extends Vt {
|
|
3207
3219
|
contextLost = !1;
|
|
3208
3220
|
_systems = [
|
|
3209
|
-
new
|
|
3210
|
-
new
|
|
3211
|
-
new
|
|
3221
|
+
new Kn(),
|
|
3222
|
+
new qt(),
|
|
3223
|
+
new hn(),
|
|
3224
|
+
new Xn(),
|
|
3225
|
+
new Nn(),
|
|
3226
|
+
new xn(),
|
|
3227
|
+
new On(),
|
|
3212
3228
|
new Zn(),
|
|
3213
|
-
new
|
|
3214
|
-
new
|
|
3215
|
-
new
|
|
3216
|
-
new
|
|
3217
|
-
new jn(),
|
|
3218
|
-
new nr(),
|
|
3219
|
-
new Tn(),
|
|
3220
|
-
new Mn()
|
|
3229
|
+
new An(),
|
|
3230
|
+
new tr(),
|
|
3231
|
+
new wn(),
|
|
3232
|
+
new jn()
|
|
3221
3233
|
];
|
|
3222
3234
|
bindPoints = /* @__PURE__ */ new Map();
|
|
3223
3235
|
supports = {
|
|
@@ -3229,13 +3241,13 @@ var nr = class extends A {
|
|
|
3229
3241
|
msaa: !0,
|
|
3230
3242
|
nonPowOf2mipmaps: !0
|
|
3231
3243
|
};
|
|
3232
|
-
constructor(e =
|
|
3244
|
+
constructor(e = C(), t) {
|
|
3233
3245
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3234
|
-
|
|
3246
|
+
et(e) ? this._setupContext(e, t) : (this.gl = e, this.version = tt(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
|
|
3235
3247
|
}
|
|
3236
3248
|
_setupContext(e, t) {
|
|
3237
3249
|
this.view = e;
|
|
3238
|
-
let n =
|
|
3250
|
+
let n = st()?.(e, t), r = n && tt(n) ? 2 : 1;
|
|
3239
3251
|
if (n || (n = e.getContext("webgl2", t) || e.getContext("experimental-webgl2", t), r = 2), n || (n = e.getContext("webgl", t) || e.getContext("experimental-webgl", t), r = 1), !n) throw Error("Unable to getContext");
|
|
3240
3252
|
return this.gl = n, this.version = r, this._contextLost = this._contextLost.bind(this), this._contextRestored = this._contextRestored.bind(this), typeof e.addEventListener == "function" && (e.addEventListener("webglcontextlost", this._contextLost, !1), e.addEventListener("webglcontextrestored", this._contextRestored, !1)), this;
|
|
3241
3253
|
}
|
|
@@ -3311,8 +3323,8 @@ var nr = class extends A {
|
|
|
3311
3323
|
height: this.screen.height * this.pixelRatio
|
|
3312
3324
|
});
|
|
3313
3325
|
}
|
|
3314
|
-
clear(e =
|
|
3315
|
-
typeof e == "boolean" && (e = e ?
|
|
3326
|
+
clear(e = Dn.all) {
|
|
3327
|
+
typeof e == "boolean" && (e = e ? Dn.all : Dn.none), e && this.gl.clear(e);
|
|
3316
3328
|
}
|
|
3317
3329
|
reset() {
|
|
3318
3330
|
this._systems.forEach((e) => e.reset());
|
|
@@ -3327,9 +3339,15 @@ var nr = class extends A {
|
|
|
3327
3339
|
let i = n * r * 4, a = n * 4, o = (r - 1) * a, s = new Uint8Array(i), c = new Uint8ClampedArray(i);
|
|
3328
3340
|
this.gl.readPixels(e, this.gl.drawingBufferHeight - t - r, n, r, this.gl.RGBA, this.gl.UNSIGNED_BYTE, s);
|
|
3329
3341
|
for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
|
|
3342
|
+
for (let e = 0; e < i; e += 4) {
|
|
3343
|
+
let t = c[e + 3];
|
|
3344
|
+
if (t === 255) continue;
|
|
3345
|
+
let n = t ? 255 / t : 0;
|
|
3346
|
+
c[e] = c[e] * n, c[e + 1] = c[e + 1] * n, c[e + 2] = c[e + 2] * n;
|
|
3347
|
+
}
|
|
3330
3348
|
return c;
|
|
3331
3349
|
}
|
|
3332
|
-
},
|
|
3350
|
+
}, rr = class {}, ir = class extends rr {
|
|
3333
3351
|
install(e) {
|
|
3334
3352
|
let t = async (e) => {
|
|
3335
3353
|
let { parseFont: t } = await import("modern-font");
|
|
@@ -3343,15 +3361,15 @@ var nr = class extends A {
|
|
|
3343
3361
|
e.register(n, t);
|
|
3344
3362
|
}), e.font = this, this;
|
|
3345
3363
|
}
|
|
3346
|
-
},
|
|
3364
|
+
}, ar = class extends Ct {
|
|
3347
3365
|
constructor(e) {
|
|
3348
3366
|
super(), this.setProperties(e);
|
|
3349
3367
|
}
|
|
3350
3368
|
};
|
|
3351
|
-
|
|
3369
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], ar.prototype, "usage", void 0), k([_({ default: () => /* @__PURE__ */ new Uint32Array() }), O("design:type", Object)], ar.prototype, "data", void 0);
|
|
3352
3370
|
//#endregion
|
|
3353
3371
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3354
|
-
var
|
|
3372
|
+
var or = class extends Ct {
|
|
3355
3373
|
constructor(e = {}) {
|
|
3356
3374
|
super(), this.setProperties(e);
|
|
3357
3375
|
}
|
|
@@ -3359,32 +3377,32 @@ var sr = class extends wt {
|
|
|
3359
3377
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3360
3378
|
}
|
|
3361
3379
|
};
|
|
3362
|
-
|
|
3380
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], or.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], or.prototype, "attributes", void 0), k([_({ default: () => new ar() }), O("design:type", ar === void 0 ? Object : ar)], or.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], or.prototype, "instanceCount", void 0);
|
|
3363
3381
|
//#endregion
|
|
3364
3382
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3365
|
-
var
|
|
3383
|
+
var P = class extends Ct {
|
|
3366
3384
|
constructor(e) {
|
|
3367
3385
|
super(), this.setProperties(e);
|
|
3368
3386
|
}
|
|
3369
3387
|
};
|
|
3370
|
-
|
|
3388
|
+
k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => /* @__PURE__ */ new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
|
|
3371
3389
|
//#endregion
|
|
3372
3390
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3373
|
-
var
|
|
3391
|
+
var F = class extends Ct {
|
|
3374
3392
|
constructor(e) {
|
|
3375
3393
|
super(), this.setProperties(e);
|
|
3376
3394
|
}
|
|
3377
3395
|
};
|
|
3378
|
-
|
|
3396
|
+
k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
|
|
3379
3397
|
//#endregion
|
|
3380
3398
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3381
|
-
var
|
|
3399
|
+
var sr = class extends or {
|
|
3382
3400
|
constructor() {
|
|
3383
3401
|
super({
|
|
3384
3402
|
topology: "triangle-strip",
|
|
3385
|
-
attributes: { position: new
|
|
3403
|
+
attributes: { position: new F({
|
|
3386
3404
|
format: "float32x2",
|
|
3387
|
-
buffer: new
|
|
3405
|
+
buffer: new P({ data: new Float32Array([
|
|
3388
3406
|
0,
|
|
3389
3407
|
0,
|
|
3390
3408
|
1,
|
|
@@ -3395,7 +3413,7 @@ var cr = class extends sr {
|
|
|
3395
3413
|
1
|
|
3396
3414
|
]) })
|
|
3397
3415
|
}) },
|
|
3398
|
-
indexBuffer: new
|
|
3416
|
+
indexBuffer: new ar({ data: new Uint32Array([
|
|
3399
3417
|
0,
|
|
3400
3418
|
1,
|
|
3401
3419
|
3,
|
|
@@ -3406,7 +3424,7 @@ var cr = class extends sr {
|
|
|
3406
3424
|
};
|
|
3407
3425
|
//#endregion
|
|
3408
3426
|
//#region src/scene/resources/materials/Material.ts
|
|
3409
|
-
function
|
|
3427
|
+
function cr() {
|
|
3410
3428
|
return {
|
|
3411
3429
|
projectionMatrix: new Float32Array([
|
|
3412
3430
|
1,
|
|
@@ -3438,13 +3456,13 @@ function lr() {
|
|
|
3438
3456
|
])
|
|
3439
3457
|
};
|
|
3440
3458
|
}
|
|
3441
|
-
var
|
|
3459
|
+
var I = class extends Ct {
|
|
3442
3460
|
static instance = new this();
|
|
3443
3461
|
glProgram;
|
|
3444
3462
|
constructor(e = {}) {
|
|
3445
3463
|
super();
|
|
3446
3464
|
let { uniforms: t, gl: n } = e;
|
|
3447
|
-
t && (this.uniforms = t), this.glProgram = new
|
|
3465
|
+
t && (this.uniforms = t), this.glProgram = new on({
|
|
3448
3466
|
vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
|
|
3449
3467
|
fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
|
|
3450
3468
|
...n
|
|
@@ -3457,13 +3475,13 @@ var F = class extends wt {
|
|
|
3457
3475
|
}, e.shader.updateUniforms(this);
|
|
3458
3476
|
}
|
|
3459
3477
|
};
|
|
3460
|
-
|
|
3478
|
+
k([_({ default: cr }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3461
3479
|
//#endregion
|
|
3462
3480
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3463
|
-
var
|
|
3464
|
-
function
|
|
3481
|
+
var lr = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, ur = /vec(\d)\((.*)\)/;
|
|
3482
|
+
function dr(e) {
|
|
3465
3483
|
e = e.trim();
|
|
3466
|
-
let t = e.match(
|
|
3484
|
+
let t = e.match(ur);
|
|
3467
3485
|
if (t) {
|
|
3468
3486
|
let e = Array.from({ length: Number(t[1]) }, () => 0);
|
|
3469
3487
|
return t[2].split(",").forEach((t, n) => {
|
|
@@ -3472,7 +3490,7 @@ function fr(e) {
|
|
|
3472
3490
|
}
|
|
3473
3491
|
return Number(e);
|
|
3474
3492
|
}
|
|
3475
|
-
var
|
|
3493
|
+
var fr = class e extends I {
|
|
3476
3494
|
static RE = {
|
|
3477
3495
|
getColor: /\sgetColor\s*\(/,
|
|
3478
3496
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3508,12 +3526,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3508
3526
|
progress: 0
|
|
3509
3527
|
}
|
|
3510
3528
|
}), this.has = n;
|
|
3511
|
-
let r = t.matchAll(
|
|
3529
|
+
let r = t.matchAll(lr);
|
|
3512
3530
|
for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
|
|
3513
|
-
this.uniforms[t.trim()] =
|
|
3531
|
+
this.uniforms[t.trim()] = dr(e[2]);
|
|
3514
3532
|
});
|
|
3515
3533
|
}
|
|
3516
|
-
},
|
|
3534
|
+
}, pr = class extends I {
|
|
3517
3535
|
static _instance;
|
|
3518
3536
|
static get instance() {
|
|
3519
3537
|
return this._instance ??= new this();
|
|
@@ -3552,7 +3570,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3552
3570
|
}
|
|
3553
3571
|
});
|
|
3554
3572
|
}
|
|
3555
|
-
},
|
|
3573
|
+
}, mr = class extends I {
|
|
3556
3574
|
static _instance;
|
|
3557
3575
|
static get instance() {
|
|
3558
3576
|
return this._instance ??= new this();
|
|
@@ -3596,20 +3614,20 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3596
3614
|
}
|
|
3597
3615
|
});
|
|
3598
3616
|
}
|
|
3599
|
-
},
|
|
3617
|
+
}, L = class extends or {
|
|
3600
3618
|
static _instance;
|
|
3601
3619
|
static get instance() {
|
|
3602
3620
|
return this._instance ??= new this();
|
|
3603
3621
|
}
|
|
3604
|
-
static draw(e, t =
|
|
3622
|
+
static draw(e, t = mr.instance, n) {
|
|
3605
3623
|
this.instance.draw(e, t, n);
|
|
3606
3624
|
}
|
|
3607
3625
|
constructor() {
|
|
3608
3626
|
super({
|
|
3609
3627
|
attributes: {
|
|
3610
|
-
position: new
|
|
3628
|
+
position: new F({
|
|
3611
3629
|
format: "float32x2",
|
|
3612
|
-
buffer: new
|
|
3630
|
+
buffer: new P({ data: new Float32Array([
|
|
3613
3631
|
-1,
|
|
3614
3632
|
-1,
|
|
3615
3633
|
1,
|
|
@@ -3620,9 +3638,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3620
3638
|
1
|
|
3621
3639
|
]) })
|
|
3622
3640
|
}),
|
|
3623
|
-
uv: new
|
|
3641
|
+
uv: new F({
|
|
3624
3642
|
format: "float32x2",
|
|
3625
|
-
buffer: new
|
|
3643
|
+
buffer: new P({ data: new Float32Array([
|
|
3626
3644
|
0,
|
|
3627
3645
|
0,
|
|
3628
3646
|
1,
|
|
@@ -3634,7 +3652,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3634
3652
|
]) })
|
|
3635
3653
|
})
|
|
3636
3654
|
},
|
|
3637
|
-
indexBuffer: new
|
|
3655
|
+
indexBuffer: new ar({ data: new Uint32Array([
|
|
3638
3656
|
0,
|
|
3639
3657
|
1,
|
|
3640
3658
|
2,
|
|
@@ -3644,27 +3662,27 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3644
3662
|
]) })
|
|
3645
3663
|
});
|
|
3646
3664
|
}
|
|
3647
|
-
},
|
|
3665
|
+
}, hr = class extends or {
|
|
3648
3666
|
positionBuffer;
|
|
3649
3667
|
uvBuffer;
|
|
3650
3668
|
constructor(e) {
|
|
3651
|
-
let t = new
|
|
3669
|
+
let t = new P({ data: /* @__PURE__ */ new Float32Array() }), n = new P({ data: /* @__PURE__ */ new Float32Array() });
|
|
3652
3670
|
super({
|
|
3653
3671
|
...e,
|
|
3654
3672
|
attributes: {
|
|
3655
|
-
position: new
|
|
3673
|
+
position: new F({
|
|
3656
3674
|
format: "float32x2",
|
|
3657
3675
|
buffer: t
|
|
3658
3676
|
}),
|
|
3659
|
-
uv: new
|
|
3677
|
+
uv: new F({
|
|
3660
3678
|
format: "float32x2",
|
|
3661
3679
|
buffer: n
|
|
3662
3680
|
})
|
|
3663
3681
|
},
|
|
3664
|
-
indexBuffer: new
|
|
3682
|
+
indexBuffer: new ar({ data: /* @__PURE__ */ new Uint32Array() })
|
|
3665
3683
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3666
3684
|
}
|
|
3667
|
-
},
|
|
3685
|
+
}, R = class extends Ct {
|
|
3668
3686
|
get valid() {
|
|
3669
3687
|
return !!(this.width && this.height);
|
|
3670
3688
|
}
|
|
@@ -3678,10 +3696,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3678
3696
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3679
3697
|
}
|
|
3680
3698
|
};
|
|
3681
|
-
|
|
3699
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
|
|
3682
3700
|
//#endregion
|
|
3683
3701
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3684
|
-
var
|
|
3702
|
+
var z = class extends Ct {
|
|
3685
3703
|
static get EMPTY() {
|
|
3686
3704
|
return new this({
|
|
3687
3705
|
width: 1,
|
|
@@ -3772,7 +3790,7 @@ var R = class extends wt {
|
|
|
3772
3790
|
switch (super._updateProperty(e, t, n), e) {
|
|
3773
3791
|
case "width":
|
|
3774
3792
|
case "height":
|
|
3775
|
-
this.isPowerOfTwo =
|
|
3793
|
+
this.isPowerOfTwo = we(this.pixelWidth) && we(this.pixelHeight);
|
|
3776
3794
|
break;
|
|
3777
3795
|
case "source":
|
|
3778
3796
|
this.updateSize();
|
|
@@ -3789,13 +3807,13 @@ var R = class extends wt {
|
|
|
3789
3807
|
e.texture.unbind(this);
|
|
3790
3808
|
}
|
|
3791
3809
|
_destroy() {
|
|
3792
|
-
super._destroy(),
|
|
3810
|
+
super._destroy(), Fe && this.source instanceof ImageBitmap && this.source.close();
|
|
3793
3811
|
}
|
|
3794
3812
|
};
|
|
3795
|
-
|
|
3813
|
+
k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
|
|
3796
3814
|
//#endregion
|
|
3797
3815
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3798
|
-
var
|
|
3816
|
+
var gr = class extends Ct {
|
|
3799
3817
|
frames;
|
|
3800
3818
|
frameIndex = 0;
|
|
3801
3819
|
get currentFrame() {
|
|
@@ -3805,7 +3823,7 @@ var _r = class extends wt {
|
|
|
3805
3823
|
super();
|
|
3806
3824
|
let t;
|
|
3807
3825
|
if (Array.isArray(e)) t = e;
|
|
3808
|
-
else if (e instanceof
|
|
3826
|
+
else if (e instanceof z) t = [{
|
|
3809
3827
|
texture: e,
|
|
3810
3828
|
duration: 0
|
|
3811
3829
|
}];
|
|
@@ -3820,12 +3838,12 @@ var _r = class extends wt {
|
|
|
3820
3838
|
e.texture.destroy();
|
|
3821
3839
|
});
|
|
3822
3840
|
}
|
|
3823
|
-
},
|
|
3841
|
+
}, _r = class extends z {
|
|
3824
3842
|
constructor(e = {}) {
|
|
3825
3843
|
super({
|
|
3826
3844
|
pixelRatio: 2,
|
|
3827
3845
|
...e,
|
|
3828
|
-
source: e.source ??
|
|
3846
|
+
source: e.source ?? C(),
|
|
3829
3847
|
uploadMethodId: "image"
|
|
3830
3848
|
});
|
|
3831
3849
|
}
|
|
@@ -3843,14 +3861,14 @@ var _r = class extends wt {
|
|
|
3843
3861
|
}
|
|
3844
3862
|
super._updateProperty(e, t, n);
|
|
3845
3863
|
}
|
|
3846
|
-
},
|
|
3864
|
+
}, vr = class e extends z {
|
|
3847
3865
|
static _cached = /* @__PURE__ */ new Map();
|
|
3848
3866
|
static get(t) {
|
|
3849
|
-
let n = new
|
|
3867
|
+
let n = new T(t), r = n.toHex(), i = this._cached.get(r);
|
|
3850
3868
|
return i || (i = new e(n), this._cached.set(r, i)), i;
|
|
3851
3869
|
}
|
|
3852
3870
|
constructor(e) {
|
|
3853
|
-
let t = e instanceof
|
|
3871
|
+
let t = e instanceof T ? e : new T(e);
|
|
3854
3872
|
super({
|
|
3855
3873
|
width: 1,
|
|
3856
3874
|
height: 1,
|
|
@@ -3864,23 +3882,23 @@ var _r = class extends wt {
|
|
|
3864
3882
|
mipmap: !0
|
|
3865
3883
|
});
|
|
3866
3884
|
}
|
|
3867
|
-
},
|
|
3885
|
+
}, B = 2048, yr = 2, br = class {
|
|
3868
3886
|
superSample = 2;
|
|
3869
3887
|
_pages = [];
|
|
3870
3888
|
_slots = /* @__PURE__ */ new Map();
|
|
3871
3889
|
_newPage() {
|
|
3872
|
-
let e = new
|
|
3890
|
+
let e = new _r({
|
|
3873
3891
|
pixelRatio: 1,
|
|
3874
3892
|
mipmap: !0
|
|
3875
3893
|
});
|
|
3876
|
-
e.width =
|
|
3877
|
-
let t = e.source ??
|
|
3878
|
-
t.width =
|
|
3894
|
+
e.width = B, e.height = B;
|
|
3895
|
+
let t = e.source ?? C(B, B);
|
|
3896
|
+
t.width = B, t.height = B;
|
|
3879
3897
|
let n = {
|
|
3880
3898
|
texture: e,
|
|
3881
3899
|
ctx: t.getContext("2d"),
|
|
3882
|
-
penX:
|
|
3883
|
-
penY:
|
|
3900
|
+
penX: yr,
|
|
3901
|
+
penY: yr,
|
|
3884
3902
|
rowH: 0
|
|
3885
3903
|
};
|
|
3886
3904
|
return this._pages.push(n), n;
|
|
@@ -3888,18 +3906,18 @@ var _r = class extends wt {
|
|
|
3888
3906
|
acquire(e, t, n, r) {
|
|
3889
3907
|
let i = this._slots.get(e);
|
|
3890
3908
|
if (i !== void 0) return i;
|
|
3891
|
-
let a = this.superSample, o = Math.ceil(t * a), s = Math.ceil(n * a), c = o +
|
|
3892
|
-
if (c >
|
|
3909
|
+
let a = this.superSample, o = Math.ceil(t * a), s = Math.ceil(n * a), c = o + yr * 2, l = s + yr * 2;
|
|
3910
|
+
if (c > B || l > B) return this._slots.set(e, null), null;
|
|
3893
3911
|
let u = this._pages[this._pages.length - 1] ?? this._newPage();
|
|
3894
|
-
u.penX + c >
|
|
3895
|
-
let d = u.penX +
|
|
3912
|
+
u.penX + c > B && (u.penX = yr, u.penY += u.rowH + yr, u.rowH = 0), u.penY + l > B && (u = this._newPage());
|
|
3913
|
+
let d = u.penX + yr, f = u.penY + yr, p = u.ctx;
|
|
3896
3914
|
p.save(), p.setTransform(a, 0, 0, a, d, f), p.beginPath(), r(p), p.restore(), u.texture.requestUpdate("source"), u.penX += c, u.rowH = Math.max(u.rowH, l);
|
|
3897
3915
|
let m = {
|
|
3898
3916
|
texture: u.texture,
|
|
3899
|
-
u0: d /
|
|
3900
|
-
v0: f /
|
|
3901
|
-
u1: (d + t * a) /
|
|
3902
|
-
v1: (f + n * a) /
|
|
3917
|
+
u0: d / B,
|
|
3918
|
+
v0: f / B,
|
|
3919
|
+
u1: (d + t * a) / B,
|
|
3920
|
+
v1: (f + n * a) / B
|
|
3903
3921
|
};
|
|
3904
3922
|
return this._slots.set(e, m), m;
|
|
3905
3923
|
}
|
|
@@ -3907,12 +3925,12 @@ var _r = class extends wt {
|
|
|
3907
3925
|
for (let e of this._pages) e.texture.destroy();
|
|
3908
3926
|
this._pages.length = 0, this._slots.clear();
|
|
3909
3927
|
}
|
|
3910
|
-
},
|
|
3928
|
+
}, xr = new br(), Sr = 4 * 1024 * 1024, Cr = 4096, wr = class e extends z {
|
|
3911
3929
|
static test(e) {
|
|
3912
3930
|
return u(e);
|
|
3913
3931
|
}
|
|
3914
3932
|
static _fitTextureSize(e, t) {
|
|
3915
|
-
let n = Math.min(1,
|
|
3933
|
+
let n = Math.min(1, Cr / e, Cr / t, Math.sqrt(Sr / (e * t)));
|
|
3916
3934
|
return {
|
|
3917
3935
|
width: Math.max(1, Math.floor(e * n)),
|
|
3918
3936
|
height: Math.max(1, Math.floor(t * n))
|
|
@@ -3921,7 +3939,7 @@ var _r = class extends wt {
|
|
|
3921
3939
|
static linearGradient(e, t, n) {
|
|
3922
3940
|
let r = Number.isFinite(t) && t > 0, i = Number.isFinite(n) && n > 0, a = Number.isFinite(e.angle);
|
|
3923
3941
|
t = r ? t : 1, n = i ? n : 1, {width: t, height: n} = this._fitTextureSize(t, n);
|
|
3924
|
-
let o =
|
|
3942
|
+
let o = C(t, n);
|
|
3925
3943
|
if (!o) throw Error("GradientTexture requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
3926
3944
|
let s = o.getContext("2d");
|
|
3927
3945
|
if (!s) throw Error("Failed to parse linear gradient, get canvas context is null.");
|
|
@@ -3948,7 +3966,7 @@ var _r = class extends wt {
|
|
|
3948
3966
|
constructor(t, n, r) {
|
|
3949
3967
|
super(e.linearGradient(t, n, r));
|
|
3950
3968
|
}
|
|
3951
|
-
},
|
|
3969
|
+
}, Tr = class extends z {
|
|
3952
3970
|
constructor(e = {}) {
|
|
3953
3971
|
super({
|
|
3954
3972
|
...e,
|
|
@@ -3958,7 +3976,7 @@ var _r = class extends wt {
|
|
|
3958
3976
|
};
|
|
3959
3977
|
//#endregion
|
|
3960
3978
|
//#region src/scene/resources/textures/VideoTexture.ts
|
|
3961
|
-
function
|
|
3979
|
+
function Er(e) {
|
|
3962
3980
|
return {
|
|
3963
3981
|
autoLoad: !!(e?.autoLoad ?? !0),
|
|
3964
3982
|
autoPlay: !!(e?.autoPlay ?? !1),
|
|
@@ -3969,7 +3987,7 @@ function Dr(e) {
|
|
|
3969
3987
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3970
3988
|
};
|
|
3971
3989
|
}
|
|
3972
|
-
var
|
|
3990
|
+
var Dr = class e extends z {
|
|
3973
3991
|
static mimeTypes = new Map(Object.entries({
|
|
3974
3992
|
ogv: "video/ogg",
|
|
3975
3993
|
mov: "video/quicktime",
|
|
@@ -4031,13 +4049,13 @@ var Or = class e extends R {
|
|
|
4031
4049
|
_reject;
|
|
4032
4050
|
_seekResolves = [];
|
|
4033
4051
|
constructor(t, n) {
|
|
4034
|
-
let r =
|
|
4035
|
-
if (
|
|
4052
|
+
let r = Er(n);
|
|
4053
|
+
if (!Qe(t)) {
|
|
4036
4054
|
typeof t == "string" && (t = [t]);
|
|
4037
4055
|
let n = t[0].src || t[0];
|
|
4038
4056
|
if (typeof document > "u") throw TypeError("VideoTexture requires a DOM <video> element and is not supported in non-browser environments.");
|
|
4039
4057
|
let i = document.createElement("video");
|
|
4040
|
-
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""),
|
|
4058
|
+
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), lt(i, n, r.crossorigin);
|
|
4041
4059
|
for (let n = 0; n < t.length; ++n) {
|
|
4042
4060
|
let { src: r, mime: a } = t[n];
|
|
4043
4061
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -4101,13 +4119,13 @@ var Or = class e extends R {
|
|
|
4101
4119
|
}
|
|
4102
4120
|
_setupAutoUpdate() {
|
|
4103
4121
|
let e = !this.source.paused && !this.source.ended;
|
|
4104
|
-
this.autoUpdate && e ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (
|
|
4122
|
+
this.autoUpdate && e ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (S.off(this.requestUpload), this._connected = !1, this._nextTime = 0), this._requestId === void 0 && (this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (S.on(this.requestUpload), this._connected = !0, this._nextTime = 0)) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected && (S.off(this.requestUpload), this._connected = !1, this._nextTime = 0));
|
|
4105
4123
|
}
|
|
4106
4124
|
_videoFrameRequestCallback = () => {
|
|
4107
4125
|
this.requestUpload(), this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
4108
4126
|
};
|
|
4109
4127
|
requestUpload = () => {
|
|
4110
|
-
let e = Math.floor(
|
|
4128
|
+
let e = Math.floor(S.elapsed * this.source.playbackRate);
|
|
4111
4129
|
this._nextTime -= e, (!this._spf || this._nextTime <= 0) && (this.requestUpdate("source"), this._nextTime = this._spf || 0);
|
|
4112
4130
|
};
|
|
4113
4131
|
async load() {
|
|
@@ -4125,16 +4143,16 @@ var Or = class e extends R {
|
|
|
4125
4143
|
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("playing", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
|
|
4126
4144
|
}
|
|
4127
4145
|
};
|
|
4128
|
-
|
|
4146
|
+
k([_({
|
|
4129
4147
|
internal: !0,
|
|
4130
4148
|
fallback: !0
|
|
4131
|
-
}),
|
|
4149
|
+
}), O("design:type", Boolean)], Dr.prototype, "autoUpdate", void 0), k([_({
|
|
4132
4150
|
internal: !0,
|
|
4133
4151
|
fallback: 0
|
|
4134
|
-
}),
|
|
4152
|
+
}), O("design:type", Number)], Dr.prototype, "fps", void 0);
|
|
4135
4153
|
//#endregion
|
|
4136
4154
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
4137
|
-
var
|
|
4155
|
+
var Or = class extends z {}, kr = class extends ue {
|
|
4138
4156
|
fillStyle;
|
|
4139
4157
|
fillRule;
|
|
4140
4158
|
strokeStyle;
|
|
@@ -4149,7 +4167,7 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4149
4167
|
_draws = [];
|
|
4150
4168
|
_triCache = [];
|
|
4151
4169
|
_parseDrawStyle(e) {
|
|
4152
|
-
return e ? e instanceof
|
|
4170
|
+
return e ? e instanceof z ? { texture: e } : { texture: vr.get(e) } : {};
|
|
4153
4171
|
}
|
|
4154
4172
|
stroke(e) {
|
|
4155
4173
|
if (!this.curves.length) return;
|
|
@@ -4240,7 +4258,7 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4240
4258
|
});
|
|
4241
4259
|
continue;
|
|
4242
4260
|
}
|
|
4243
|
-
let { path: r, ...i } = t, a = i.type === "stroke" ? i.lineStyle : void 0, o = i.type === "stroke", s = o ? i.flow : void 0, c = o && (!i.texture || i.texture instanceof
|
|
4261
|
+
let { path: r, ...i } = t, a = i.type === "stroke" ? i.lineStyle : void 0, o = i.type === "stroke", s = o ? i.flow : void 0, c = o && (!i.texture || i.texture instanceof vr), l = o && (!!s || c), u = `${i.type}|${r.toData()}|${a ? `${a.width},${a.cap},${a.join},${a.alignment},${a.miterLimit}` : ""}${l ? "|uv" : ""}`, d = this._triCache[n];
|
|
4244
4262
|
if (!d || d.sig !== u) {
|
|
4245
4263
|
let e = [], t = [], a = l ? [] : void 0;
|
|
4246
4264
|
i.type === "fill" ? r.fillTriangulate({
|
|
@@ -4266,7 +4284,7 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4266
4284
|
indices: d.indices,
|
|
4267
4285
|
meshUvs: d.uvs ?? i.meshUvs,
|
|
4268
4286
|
effectFlags: c && d.uvs && !s ? 2 : 0,
|
|
4269
|
-
effectParam: s && d.uvs ?
|
|
4287
|
+
effectParam: s && d.uvs ? It(s) : 0
|
|
4270
4288
|
});
|
|
4271
4289
|
}
|
|
4272
4290
|
return this._triCache.length = this._draws.length, e;
|
|
@@ -4274,7 +4292,7 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4274
4292
|
destroy() {
|
|
4275
4293
|
this.reset(), this._triCache.length = 0;
|
|
4276
4294
|
}
|
|
4277
|
-
},
|
|
4295
|
+
}, Ar = class {
|
|
4278
4296
|
front = [];
|
|
4279
4297
|
default = [];
|
|
4280
4298
|
back = [];
|
|
@@ -4317,7 +4335,7 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4317
4335
|
toJSON() {
|
|
4318
4336
|
return [...this.default];
|
|
4319
4337
|
}
|
|
4320
|
-
},
|
|
4338
|
+
}, jr = class extends w {
|
|
4321
4339
|
parent;
|
|
4322
4340
|
getPropertyDeclarations() {
|
|
4323
4341
|
super.getPropertyDeclarations();
|
|
@@ -4336,22 +4354,22 @@ var kr = class extends R {}, Ar = class extends ue {
|
|
|
4336
4354
|
deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
|
|
4337
4355
|
});
|
|
4338
4356
|
}
|
|
4339
|
-
},
|
|
4340
|
-
function
|
|
4341
|
-
let t =
|
|
4342
|
-
return t++,
|
|
4357
|
+
}, Mr, Nr = {};
|
|
4358
|
+
function Pr(e) {
|
|
4359
|
+
let t = Nr[e] ?? 0;
|
|
4360
|
+
return t++, Nr[e] = t, t;
|
|
4343
4361
|
}
|
|
4344
|
-
var
|
|
4362
|
+
var V = Mr = class extends w {
|
|
4345
4363
|
static parse(e, t = "Node") {
|
|
4346
4364
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4347
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((
|
|
4365
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ?? Mr)({
|
|
4348
4366
|
...a,
|
|
4349
4367
|
meta: r
|
|
4350
4368
|
});
|
|
4351
4369
|
return i?.forEach((e) => o.appendChild(this.parse(e))), o;
|
|
4352
4370
|
}
|
|
4353
4371
|
_mask;
|
|
4354
|
-
_meta = new
|
|
4372
|
+
_meta = new jr(this);
|
|
4355
4373
|
get meta() {
|
|
4356
4374
|
return this._meta;
|
|
4357
4375
|
}
|
|
@@ -4374,7 +4392,7 @@ var B = Nr = class extends C {
|
|
|
4374
4392
|
}).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
|
|
4375
4393
|
}
|
|
4376
4394
|
_defaultName() {
|
|
4377
|
-
return `@${this.is}@${
|
|
4395
|
+
return `@${this.is}@${Pr(this.is)}`;
|
|
4378
4396
|
}
|
|
4379
4397
|
setProperties(e) {
|
|
4380
4398
|
if (e) {
|
|
@@ -4441,7 +4459,7 @@ var B = Nr = class extends C {
|
|
|
4441
4459
|
}
|
|
4442
4460
|
return this;
|
|
4443
4461
|
}
|
|
4444
|
-
_children = new
|
|
4462
|
+
_children = new Ar();
|
|
4445
4463
|
get children() {
|
|
4446
4464
|
return this._children.default;
|
|
4447
4465
|
}
|
|
@@ -4601,7 +4619,7 @@ var B = Nr = class extends C {
|
|
|
4601
4619
|
append(...e) {
|
|
4602
4620
|
let t;
|
|
4603
4621
|
t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
|
|
4604
|
-
e instanceof
|
|
4622
|
+
e instanceof Mr ? this.appendChild(e) : this.appendChild(Mr.parse(e));
|
|
4605
4623
|
});
|
|
4606
4624
|
}
|
|
4607
4625
|
before(...e) {
|
|
@@ -4704,13 +4722,13 @@ var B = Nr = class extends C {
|
|
|
4704
4722
|
});
|
|
4705
4723
|
}
|
|
4706
4724
|
};
|
|
4707
|
-
|
|
4725
|
+
k([_({ default: () => c() }), O("design:type", String)], V.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], V.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], V.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], V.prototype, "internalMode", void 0), k([_({
|
|
4708
4726
|
internal: !0,
|
|
4709
4727
|
default: !0
|
|
4710
|
-
}),
|
|
4728
|
+
}), O("design:type", Boolean)], V.prototype, "needsRender", void 0), V = Mr = k([x("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4711
4729
|
//#endregion
|
|
4712
4730
|
//#region src/scene/main/TimelineNode.ts
|
|
4713
|
-
var
|
|
4731
|
+
var H = class extends V {
|
|
4714
4732
|
insideTimeRange = !1;
|
|
4715
4733
|
get _timeline() {
|
|
4716
4734
|
return this._tree?.timeline;
|
|
@@ -4746,7 +4764,7 @@ var Ir = class extends B {
|
|
|
4746
4764
|
return this._globalStartTime + this._globalDuration;
|
|
4747
4765
|
}
|
|
4748
4766
|
get currentTimeProgress() {
|
|
4749
|
-
return this._duration ?
|
|
4767
|
+
return this._duration ? E(this._currentTime / this._duration, 0, 1) : 0;
|
|
4750
4768
|
}
|
|
4751
4769
|
isInsideTimeRange() {
|
|
4752
4770
|
let e = this._currentTime;
|
|
@@ -4792,18 +4810,18 @@ var Ir = class extends B {
|
|
|
4792
4810
|
super._process(e), this._updateCurrentTime();
|
|
4793
4811
|
}
|
|
4794
4812
|
};
|
|
4795
|
-
|
|
4813
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "paused", void 0), H = k([x("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
|
|
4796
4814
|
//#endregion
|
|
4797
4815
|
//#region src/scene/main/CanvasItem.ts
|
|
4798
|
-
var
|
|
4799
|
-
function
|
|
4800
|
-
|
|
4816
|
+
var Fr = [], Ir = 0;
|
|
4817
|
+
function Lr() {
|
|
4818
|
+
Ir = 0;
|
|
4801
4819
|
}
|
|
4802
|
-
function
|
|
4803
|
-
let i =
|
|
4804
|
-
return i || (i = {},
|
|
4820
|
+
function Rr(e, t, n, r) {
|
|
4821
|
+
let i = Fr[Ir];
|
|
4822
|
+
return i || (i = {}, Fr[Ir] = i), Ir++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i.__source = e, i;
|
|
4805
4823
|
}
|
|
4806
|
-
var
|
|
4824
|
+
var zr = class extends H {
|
|
4807
4825
|
_blendMode;
|
|
4808
4826
|
_parentGlobalVisible;
|
|
4809
4827
|
_globalVisible;
|
|
@@ -4821,7 +4839,7 @@ var Vr = class extends Ir {
|
|
|
4821
4839
|
255,
|
|
4822
4840
|
255
|
|
4823
4841
|
];
|
|
4824
|
-
context = new
|
|
4842
|
+
context = new kr();
|
|
4825
4843
|
_resetContext = !0;
|
|
4826
4844
|
needsDraw = !0;
|
|
4827
4845
|
needsLayout = !1;
|
|
@@ -4883,7 +4901,7 @@ var Vr = class extends Ir {
|
|
|
4883
4901
|
}
|
|
4884
4902
|
_updateGlobalOpacity() {
|
|
4885
4903
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4886
|
-
let e =
|
|
4904
|
+
let e = E(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4887
4905
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4888
4906
|
}
|
|
4889
4907
|
_draw() {
|
|
@@ -4952,7 +4970,7 @@ var Vr = class extends Ir {
|
|
|
4952
4970
|
return;
|
|
4953
4971
|
}
|
|
4954
4972
|
let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
|
|
4955
|
-
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof
|
|
4973
|
+
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof Or && (a = this._handleViewportTexture(i)), e.batch2D.render(Rr(i, n, t ? i.size : void 0, a));
|
|
4956
4974
|
super._render(e);
|
|
4957
4975
|
}
|
|
4958
4976
|
_cullsRender() {
|
|
@@ -4962,19 +4980,19 @@ var Vr = class extends Ir {
|
|
|
4962
4980
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4963
4981
|
}
|
|
4964
4982
|
};
|
|
4965
|
-
|
|
4983
|
+
k([_(), O("design:type", Object)], zr.prototype, "blendMode", void 0), k([_({
|
|
4966
4984
|
internal: !0,
|
|
4967
4985
|
fallback: !0
|
|
4968
|
-
}),
|
|
4986
|
+
}), O("design:type", Boolean)], zr.prototype, "visible", void 0), k([_({
|
|
4969
4987
|
internal: !0,
|
|
4970
4988
|
fallback: 1
|
|
4971
|
-
}),
|
|
4989
|
+
}), O("design:type", Number)], zr.prototype, "opacity", void 0), zr = k([x("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zr);
|
|
4972
4990
|
//#endregion
|
|
4973
4991
|
//#region src/scene/main/Viewport.ts
|
|
4974
|
-
var
|
|
4992
|
+
var U = class extends V {
|
|
4975
4993
|
canvasTransform = new v();
|
|
4976
4994
|
renderTargetIndex = 0;
|
|
4977
|
-
renderTargets = [new
|
|
4995
|
+
renderTargets = [new R(), new R()];
|
|
4978
4996
|
get valid() {
|
|
4979
4997
|
return !!(this.width && this.height);
|
|
4980
4998
|
}
|
|
@@ -5021,7 +5039,7 @@ var V = class extends B {
|
|
|
5021
5039
|
return !1;
|
|
5022
5040
|
}
|
|
5023
5041
|
activateWithCopy(e, t) {
|
|
5024
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
5042
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, mr.instance, { sampler: 0 }));
|
|
5025
5043
|
}
|
|
5026
5044
|
renderStart(e, t) {
|
|
5027
5045
|
this.activate(e, t) && e.clear();
|
|
@@ -5034,7 +5052,7 @@ var V = class extends B {
|
|
|
5034
5052
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
5035
5053
|
}
|
|
5036
5054
|
getRect() {
|
|
5037
|
-
return new
|
|
5055
|
+
return new Tt(this.x, this.y, this.width, this.height);
|
|
5038
5056
|
}
|
|
5039
5057
|
toCanvasGlobal(e, t) {
|
|
5040
5058
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -5046,16 +5064,16 @@ var V = class extends B {
|
|
|
5046
5064
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
5047
5065
|
}
|
|
5048
5066
|
};
|
|
5049
|
-
|
|
5067
|
+
k([_({ fallback: 0 }), O("design:type", Number)], U.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], U.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], U.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], U.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], U.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], U.prototype, "msaa", void 0), U = k([x("Viewport")], U);
|
|
5050
5068
|
//#endregion
|
|
5051
5069
|
//#region src/scene/main/Effect.ts
|
|
5052
|
-
var
|
|
5070
|
+
var W = class extends H {
|
|
5053
5071
|
material;
|
|
5054
5072
|
get _effectMode() {
|
|
5055
5073
|
return this.effectMode ?? "parent";
|
|
5056
5074
|
}
|
|
5057
|
-
viewport1 = new
|
|
5058
|
-
viewport2 = new
|
|
5075
|
+
viewport1 = new U();
|
|
5076
|
+
viewport2 = new U();
|
|
5059
5077
|
_renderId = 0;
|
|
5060
5078
|
_renderViewport;
|
|
5061
5079
|
_previousSibling;
|
|
@@ -5072,7 +5090,7 @@ var H = class extends Ir {
|
|
|
5072
5090
|
_updateProperty(e, t, n) {
|
|
5073
5091
|
switch (super._updateProperty(e, t, n), e) {
|
|
5074
5092
|
case "glsl": {
|
|
5075
|
-
let e = new
|
|
5093
|
+
let e = new fr(t);
|
|
5076
5094
|
!this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
|
|
5077
5095
|
break;
|
|
5078
5096
|
}
|
|
@@ -5107,7 +5125,7 @@ var H = class extends Ir {
|
|
|
5107
5125
|
}
|
|
5108
5126
|
}
|
|
5109
5127
|
getRect() {
|
|
5110
|
-
return new
|
|
5128
|
+
return new Tt(this._rect);
|
|
5111
5129
|
}
|
|
5112
5130
|
_processParent() {
|
|
5113
5131
|
let e = this._tree?.renderStack;
|
|
@@ -5260,13 +5278,13 @@ var H = class extends Ir {
|
|
|
5260
5278
|
}
|
|
5261
5279
|
apply(e, t, n) {
|
|
5262
5280
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
5263
|
-
|
|
5281
|
+
L.draw(e, this.material, {
|
|
5264
5282
|
from: 0,
|
|
5265
5283
|
to: 1,
|
|
5266
5284
|
progress: this.currentTimeProgress,
|
|
5267
5285
|
ratio: t.width / t.height
|
|
5268
5286
|
});
|
|
5269
|
-
}) :
|
|
5287
|
+
}) : L.draw(e, this.material, {
|
|
5270
5288
|
from: 0,
|
|
5271
5289
|
to: 1,
|
|
5272
5290
|
progress: this.currentTimeProgress,
|
|
@@ -5277,10 +5295,10 @@ var H = class extends Ir {
|
|
|
5277
5295
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
5278
5296
|
}
|
|
5279
5297
|
};
|
|
5280
|
-
|
|
5298
|
+
k([_({ internal: !0 }), O("design:type", Object)], W.prototype, "material", void 0), k([_(), O("design:type", Object)], W.prototype, "effectMode", void 0), k([_(), O("design:type", String)], W.prototype, "glsl", void 0), k([_(), O("design:type", String)], W.prototype, "glslSrc", void 0), W = k([x("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5281
5299
|
//#endregion
|
|
5282
5300
|
//#region src/scene/main/RenderStack.ts
|
|
5283
|
-
var
|
|
5301
|
+
var Br = class {
|
|
5284
5302
|
currentCall;
|
|
5285
5303
|
calls = [];
|
|
5286
5304
|
createCall(e) {
|
|
@@ -5305,7 +5323,7 @@ var Hr = class {
|
|
|
5305
5323
|
});
|
|
5306
5324
|
}), this.reset();
|
|
5307
5325
|
}
|
|
5308
|
-
},
|
|
5326
|
+
}, Vr, Hr = Vr = class extends V {
|
|
5309
5327
|
currentTime = 0;
|
|
5310
5328
|
playing = !1;
|
|
5311
5329
|
playbackRate = 1;
|
|
@@ -5326,7 +5344,7 @@ var Hr = class {
|
|
|
5326
5344
|
}
|
|
5327
5345
|
static from(e, t = !1) {
|
|
5328
5346
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
5329
|
-
return new
|
|
5347
|
+
return new Vr({
|
|
5330
5348
|
startTime: n,
|
|
5331
5349
|
endTime: r,
|
|
5332
5350
|
loop: t
|
|
@@ -5344,7 +5362,7 @@ var Hr = class {
|
|
|
5344
5362
|
}
|
|
5345
5363
|
addTime(e) {
|
|
5346
5364
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = t - n, i = this.currentTime + e;
|
|
5347
|
-
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i =
|
|
5365
|
+
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i = E(i, n, t), this.currentTime = i, this.emit("updateCurrentTime", i, e), this;
|
|
5348
5366
|
}
|
|
5349
5367
|
play(e) {
|
|
5350
5368
|
return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
|
|
@@ -5372,10 +5390,10 @@ var Hr = class {
|
|
|
5372
5390
|
super._process(e), this.paused || this.addTime(e);
|
|
5373
5391
|
}
|
|
5374
5392
|
};
|
|
5375
|
-
|
|
5393
|
+
k([_({ fallback: 0 }), O("design:type", Number)], Hr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], Hr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Hr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Hr.prototype, "paused", void 0), Hr = Vr = k([x("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Hr);
|
|
5376
5394
|
//#endregion
|
|
5377
5395
|
//#region src/scene/main/Window.ts
|
|
5378
|
-
var
|
|
5396
|
+
var Ur = class extends U {
|
|
5379
5397
|
constructor() {
|
|
5380
5398
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
5381
5399
|
}
|
|
@@ -5386,24 +5404,24 @@ var Gr = class extends V {
|
|
|
5386
5404
|
super.flush(e), this.finish(e);
|
|
5387
5405
|
}
|
|
5388
5406
|
};
|
|
5389
|
-
|
|
5407
|
+
Ur = k([x("Window", {
|
|
5390
5408
|
processMode: "always",
|
|
5391
5409
|
renderMode: "always"
|
|
5392
|
-
}),
|
|
5410
|
+
}), O("design:paramtypes", [])], Ur);
|
|
5393
5411
|
//#endregion
|
|
5394
5412
|
//#region src/scene/main/SceneTree.ts
|
|
5395
|
-
var
|
|
5396
|
-
input = new
|
|
5397
|
-
renderStack = new
|
|
5398
|
-
root = new
|
|
5399
|
-
timeline = new
|
|
5413
|
+
var G = class extends jt {
|
|
5414
|
+
input = new xt();
|
|
5415
|
+
renderStack = new Br();
|
|
5416
|
+
root = new Ur().setTree(this);
|
|
5417
|
+
timeline = new Hr().setTree(this);
|
|
5400
5418
|
imagePipelineResolver;
|
|
5401
5419
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5402
5420
|
_boundFonts;
|
|
5403
5421
|
_textRemeasureScheduled = !1;
|
|
5404
5422
|
_onFontLoad = () => this._scheduleTextRemeasure();
|
|
5405
|
-
_backgroundColor = new
|
|
5406
|
-
_flowColor = new
|
|
5423
|
+
_backgroundColor = new T();
|
|
5424
|
+
_flowColor = new T();
|
|
5407
5425
|
_flowColorArray;
|
|
5408
5426
|
_previousViewport;
|
|
5409
5427
|
_currentViewport;
|
|
@@ -5431,9 +5449,9 @@ var U = class extends Mt {
|
|
|
5431
5449
|
}
|
|
5432
5450
|
constructor(e) {
|
|
5433
5451
|
super(), this.on("nodeEnter", (e) => {
|
|
5434
|
-
this.nodeMap.set(e.id, e), e.applyThemeColors?.(),
|
|
5452
|
+
this.nodeMap.set(e.id, e), e.applyThemeColors?.(), ft();
|
|
5435
5453
|
}), this.on("nodeExit", (e) => {
|
|
5436
|
-
this.nodeMap.delete(e.id),
|
|
5454
|
+
this.nodeMap.delete(e.id), ft();
|
|
5437
5455
|
}), this.setProperties(e), this._bindFonts(this.fonts);
|
|
5438
5456
|
}
|
|
5439
5457
|
_bindFonts(e) {
|
|
@@ -5478,44 +5496,44 @@ var U = class extends Mt {
|
|
|
5478
5496
|
this.renderStack.reset(), this.timeline.emit("process", e), this.emit("processing"), this.root.emit("process", e), this.emit("processed");
|
|
5479
5497
|
}
|
|
5480
5498
|
_render(e) {
|
|
5481
|
-
this.emit("rendering"),
|
|
5499
|
+
this.emit("rendering"), Lr(), e.batch2D.beginFrame(), this._flowColorArray && (e.batch2D.effectUniforms.uFlowColor = this._flowColorArray), this.flowPeriod && (e.batch2D.effectUniforms.uFlowPeriod = this.flowPeriod), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
|
|
5482
5500
|
}
|
|
5483
5501
|
_renderScreen(e) {
|
|
5484
5502
|
this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
|
|
5485
5503
|
let t = this.root.texture;
|
|
5486
|
-
t.activate(e, 0), this.fxaa ?
|
|
5504
|
+
t.activate(e, 0), this.fxaa ? L.draw(e, pr.instance, {
|
|
5487
5505
|
sampler: 0,
|
|
5488
5506
|
texelSize: [1 / (t.pixelWidth || t.width || 1), 1 / (t.pixelHeight || t.height || 1)]
|
|
5489
|
-
}) :
|
|
5507
|
+
}) : L.draw(e), t.inactivate(e);
|
|
5490
5508
|
}
|
|
5491
5509
|
_destroy() {
|
|
5492
5510
|
super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5493
5511
|
}
|
|
5494
5512
|
};
|
|
5495
|
-
|
|
5513
|
+
k([_({ alias: "root.msaa" }), O("design:type", Boolean)], G.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "fxaa", void 0), k([_(), O("design:type", Object)], G.prototype, "flowColor", void 0), k([_(), O("design:type", Number)], G.prototype, "flowPeriod", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], G.prototype, "backgroundColor", void 0), k([_({ fallback: "light" }), O("design:type", String)], G.prototype, "theme", void 0), k([_(), O("design:type", Object)], G.prototype, "themeTokens", void 0), k([_({
|
|
5496
5514
|
internal: !0,
|
|
5497
5515
|
fallback: !1
|
|
5498
|
-
}),
|
|
5516
|
+
}), O("design:type", Boolean)], G.prototype, "debug", void 0), k([_({
|
|
5499
5517
|
internal: !0,
|
|
5500
5518
|
fallback: !1
|
|
5501
|
-
}),
|
|
5519
|
+
}), O("design:type", Boolean)], G.prototype, "processPaused", void 0), k([_({
|
|
5502
5520
|
internal: !0,
|
|
5503
|
-
default: () =>
|
|
5504
|
-
}),
|
|
5521
|
+
default: () => ge
|
|
5522
|
+
}), O("design:type", Object)], G.prototype, "fonts", void 0);
|
|
5505
5523
|
//#endregion
|
|
5506
5524
|
//#region src/scene/main/Transition.ts
|
|
5507
|
-
var
|
|
5525
|
+
var Wr = class extends W {
|
|
5508
5526
|
constructor(e, t = []) {
|
|
5509
5527
|
super(), this.setProperties(e).append(t);
|
|
5510
5528
|
}
|
|
5511
5529
|
};
|
|
5512
|
-
|
|
5530
|
+
Wr = k([x("Transition", {
|
|
5513
5531
|
effectMode: "transition",
|
|
5514
5532
|
duration: 2e3
|
|
5515
|
-
}),
|
|
5533
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
|
|
5516
5534
|
//#endregion
|
|
5517
5535
|
//#region src/scene/2d/Node2D.ts
|
|
5518
|
-
var
|
|
5536
|
+
var Gr = new v(), Kr = class extends zr {
|
|
5519
5537
|
rotation = 0;
|
|
5520
5538
|
position = new y(0, 0, () => this.updateGlobalTransform());
|
|
5521
5539
|
contentOffset = new y(0, 0, () => this.updateGlobalTransform());
|
|
@@ -5546,7 +5564,7 @@ var qr = new v(), Jr = class extends Vr {
|
|
|
5546
5564
|
let s = o.x, c = o.y;
|
|
5547
5565
|
if (this.globalPosition.set(t.x + this.position.x - s, t.y + this.position.y - c), this.globalScale.set(n.x * this.scale.x, n.y * this.scale.y), this.globalSkew.set(r.x * this.skew.x, r.y * this.skew.y), this.globalRotation = i + this.rotation, s !== 0 || c !== 0) {
|
|
5548
5566
|
let t = e.globalTransform;
|
|
5549
|
-
|
|
5567
|
+
Gr.copyFrom(t), Gr.tx = t.tx - s * t.a - c * t.c, Gr.ty = t.ty - s * t.b - c * t.d, this.globalTransform.appendFrom(this.transform, Gr);
|
|
5550
5568
|
} else this.globalTransform.appendFrom(this.transform, e.globalTransform);
|
|
5551
5569
|
} else this.globalPosition.copyFrom(this.position), this.globalScale.copyFrom(this.scale), this.globalSkew.copyFrom(this.skew), this.globalRotation = this.rotation, this.globalTransform.copyFrom(this.transform);
|
|
5552
5570
|
this.requestLayout(), this.emit("updateGlobalTransform");
|
|
@@ -5573,10 +5591,10 @@ var qr = new v(), Jr = class extends Vr {
|
|
|
5573
5591
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5574
5592
|
}
|
|
5575
5593
|
};
|
|
5576
|
-
|
|
5594
|
+
Kr = k([x("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
|
|
5577
5595
|
//#endregion
|
|
5578
5596
|
//#region src/scene/2d/Camera2D.ts
|
|
5579
|
-
var
|
|
5597
|
+
var qr = class extends Kr {
|
|
5580
5598
|
canvasTransform = new v();
|
|
5581
5599
|
_screenOffset = {
|
|
5582
5600
|
x: 0,
|
|
@@ -5617,7 +5635,7 @@ var Yr = class extends Jr {
|
|
|
5617
5635
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5618
5636
|
}
|
|
5619
5637
|
setZoom(e, t = e) {
|
|
5620
|
-
return this._zoom.set(
|
|
5638
|
+
return this._zoom.set(E(e, this._minZoom.x, this._maxZoom.x), E(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5621
5639
|
}
|
|
5622
5640
|
setZoomAtOrigin(e, t, n) {
|
|
5623
5641
|
let r;
|
|
@@ -5690,7 +5708,7 @@ var Yr = class extends Jr {
|
|
|
5690
5708
|
});
|
|
5691
5709
|
}
|
|
5692
5710
|
_getZoomByWheel(e, t) {
|
|
5693
|
-
let n = e.ctrlKey &&
|
|
5711
|
+
let n = e.ctrlKey && Ye ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5694
5712
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5695
5713
|
}
|
|
5696
5714
|
_updateTransform() {
|
|
@@ -5720,19 +5738,19 @@ var Yr = class extends Jr {
|
|
|
5720
5738
|
};
|
|
5721
5739
|
}
|
|
5722
5740
|
};
|
|
5723
|
-
|
|
5741
|
+
k([_({
|
|
5724
5742
|
internal: !0,
|
|
5725
5743
|
fallback: !1
|
|
5726
|
-
}),
|
|
5744
|
+
}), O("design:type", Boolean)], qr.prototype, "spaceKey", void 0), k([_({
|
|
5727
5745
|
internal: !0,
|
|
5728
5746
|
fallback: !1
|
|
5729
|
-
}),
|
|
5747
|
+
}), O("design:type", Boolean)], qr.prototype, "grabbing", void 0), qr = k([x("Camera2D", {
|
|
5730
5748
|
processMode: "disabled",
|
|
5731
5749
|
renderMode: "disabled"
|
|
5732
|
-
}),
|
|
5750
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], qr);
|
|
5733
5751
|
//#endregion
|
|
5734
5752
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5735
|
-
function
|
|
5753
|
+
function Jr(e, t) {
|
|
5736
5754
|
return Math.abs(e) >= Math.abs(t) ? {
|
|
5737
5755
|
x: Math.sign(e) || 1,
|
|
5738
5756
|
y: 0
|
|
@@ -5741,11 +5759,11 @@ function Xr(e, t) {
|
|
|
5741
5759
|
y: Math.sign(t) || 1
|
|
5742
5760
|
};
|
|
5743
5761
|
}
|
|
5744
|
-
function
|
|
5762
|
+
function Yr(e, t, n, r = {}) {
|
|
5745
5763
|
let i = t.point, a = n.point, o = new ue();
|
|
5746
5764
|
switch (e) {
|
|
5747
5765
|
case "curved": {
|
|
5748
|
-
let e = t.dir ??
|
|
5766
|
+
let e = t.dir ?? Jr(a.x - i.x, a.y - i.y), s = n.dir ?? Jr(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
|
|
5749
5767
|
for (let e = 0; e <= 32; e++) {
|
|
5750
5768
|
let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, u = r * i.x + s * ee + c * ne + l * a.x, d = r * i.y + s * te + c * re + l * a.y;
|
|
5751
5769
|
e === 0 ? o.moveTo(u, d) : o.lineTo(u, d);
|
|
@@ -5753,7 +5771,7 @@ function Zr(e, t, n, r = {}) {
|
|
|
5753
5771
|
break;
|
|
5754
5772
|
}
|
|
5755
5773
|
case "orthogonal": {
|
|
5756
|
-
let e =
|
|
5774
|
+
let e = Zr(t, n, r);
|
|
5757
5775
|
for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
|
|
5758
5776
|
break;
|
|
5759
5777
|
}
|
|
@@ -5763,11 +5781,11 @@ function Zr(e, t, n, r = {}) {
|
|
|
5763
5781
|
}
|
|
5764
5782
|
return o;
|
|
5765
5783
|
}
|
|
5766
|
-
function
|
|
5767
|
-
return
|
|
5784
|
+
function Xr(e) {
|
|
5785
|
+
return Jr(e.x, e.y);
|
|
5768
5786
|
}
|
|
5769
|
-
function
|
|
5770
|
-
let r = e.point, i = t.point, a = n.stub ?? 16, o =
|
|
5787
|
+
function Zr(e, t, n) {
|
|
5788
|
+
let r = e.point, i = t.point, a = n.stub ?? 16, o = Xr(e.dir ?? Jr(i.x - r.x, i.y - r.y)), s = Xr(t.dir ?? Jr(r.x - i.x, r.y - i.y)), c = {
|
|
5771
5789
|
x: r.x + o.x * a,
|
|
5772
5790
|
y: r.y + o.y * a
|
|
5773
5791
|
}, l = {
|
|
@@ -5779,12 +5797,12 @@ function $r(e, t, n) {
|
|
|
5779
5797
|
x: r.x,
|
|
5780
5798
|
y: r.y
|
|
5781
5799
|
}, c];
|
|
5782
|
-
return d.push(
|
|
5800
|
+
return d.push(...$r(c, o, l, s, a, u)), d.push(l, {
|
|
5783
5801
|
x: i.x,
|
|
5784
5802
|
y: i.y
|
|
5785
|
-
}),
|
|
5803
|
+
}), ei(d);
|
|
5786
5804
|
}
|
|
5787
|
-
function
|
|
5805
|
+
function Qr(e, t, n, r, i) {
|
|
5788
5806
|
let a = Infinity, o = -Infinity, s = t === "y" ? "x" : "y";
|
|
5789
5807
|
for (let e of r) {
|
|
5790
5808
|
let r = e.min[s], i = r + e.size[s];
|
|
@@ -5795,7 +5813,7 @@ function ei(e, t, n, r, i) {
|
|
|
5795
5813
|
}
|
|
5796
5814
|
return e > a && e < o ? a - i : e;
|
|
5797
5815
|
}
|
|
5798
|
-
function
|
|
5816
|
+
function $r(e, t, n, r, i, a = []) {
|
|
5799
5817
|
let o = t.y === 0;
|
|
5800
5818
|
if (o === (r.y === 0)) {
|
|
5801
5819
|
if (o) {
|
|
@@ -5810,7 +5828,7 @@ function ti(e, t, n, r, i, a = []) {
|
|
|
5810
5828
|
}];
|
|
5811
5829
|
}
|
|
5812
5830
|
let o = Math.abs(e.y - n.y) < .001 ? e.y + i : (e.y + n.y) / 2;
|
|
5813
|
-
return o =
|
|
5831
|
+
return o = Qr(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
|
|
5814
5832
|
x: e.x,
|
|
5815
5833
|
y: o
|
|
5816
5834
|
}, {
|
|
@@ -5829,7 +5847,7 @@ function ti(e, t, n, r, i, a = []) {
|
|
|
5829
5847
|
}];
|
|
5830
5848
|
}
|
|
5831
5849
|
let s = Math.abs(e.x - n.x) < .001 ? e.x + i : (e.x + n.x) / 2;
|
|
5832
|
-
return s =
|
|
5850
|
+
return s = Qr(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
|
|
5833
5851
|
x: s,
|
|
5834
5852
|
y: e.y
|
|
5835
5853
|
}, {
|
|
@@ -5856,7 +5874,7 @@ function ti(e, t, n, r, i, a = []) {
|
|
|
5856
5874
|
y: l.y
|
|
5857
5875
|
}];
|
|
5858
5876
|
}
|
|
5859
|
-
function
|
|
5877
|
+
function ei(e) {
|
|
5860
5878
|
let t = [];
|
|
5861
5879
|
for (let n = 0; n < e.length; n++) {
|
|
5862
5880
|
let r = e[n], i = t[t.length - 1];
|
|
@@ -5866,7 +5884,7 @@ function ni(e) {
|
|
|
5866
5884
|
}
|
|
5867
5885
|
//#endregion
|
|
5868
5886
|
//#region src/css/parseCssFilter.ts
|
|
5869
|
-
var
|
|
5887
|
+
var ti = {
|
|
5870
5888
|
brightness: 1,
|
|
5871
5889
|
contrast: 1,
|
|
5872
5890
|
grayscale: 0,
|
|
@@ -5876,18 +5894,18 @@ var ri = {
|
|
|
5876
5894
|
saturate: 1,
|
|
5877
5895
|
sepia: 0
|
|
5878
5896
|
};
|
|
5879
|
-
function
|
|
5880
|
-
let t = new
|
|
5897
|
+
function ni(e) {
|
|
5898
|
+
let t = new Ot();
|
|
5881
5899
|
if (e === "none") return t;
|
|
5882
|
-
let n =
|
|
5883
|
-
Object.keys(
|
|
5884
|
-
n[e] = n[e] ??
|
|
5900
|
+
let n = je(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5901
|
+
Object.keys(ti).forEach((e) => {
|
|
5902
|
+
n[e] = n[e] ?? ti[e];
|
|
5885
5903
|
});
|
|
5886
5904
|
for (let e in n) {
|
|
5887
5905
|
let r = n[e];
|
|
5888
5906
|
switch (e) {
|
|
5889
5907
|
case "hue-rotate":
|
|
5890
|
-
t.hueRotate(r *
|
|
5908
|
+
t.hueRotate(r * Ce);
|
|
5891
5909
|
break;
|
|
5892
5910
|
case "saturate":
|
|
5893
5911
|
t.saturate(r);
|
|
@@ -5916,7 +5934,7 @@ function ii(e) {
|
|
|
5916
5934
|
}
|
|
5917
5935
|
//#endregion
|
|
5918
5936
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5919
|
-
function
|
|
5937
|
+
function ri(e) {
|
|
5920
5938
|
let [t, n = t] = e.split(" ");
|
|
5921
5939
|
return [t, n].map((e) => {
|
|
5922
5940
|
switch (e = e.trim(), e) {
|
|
@@ -5931,11 +5949,11 @@ function ai(e) {
|
|
|
5931
5949
|
}
|
|
5932
5950
|
//#endregion
|
|
5933
5951
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5934
|
-
var
|
|
5952
|
+
var ii, K = class extends W {
|
|
5935
5953
|
static {
|
|
5936
|
-
|
|
5954
|
+
ii = this;
|
|
5937
5955
|
}
|
|
5938
|
-
static material = new
|
|
5956
|
+
static material = new I({ gl: {
|
|
5939
5957
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5940
5958
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
|
|
5941
5959
|
} });
|
|
@@ -5944,7 +5962,7 @@ var oi, W = class extends H {
|
|
|
5944
5962
|
}
|
|
5945
5963
|
apply(e, t) {
|
|
5946
5964
|
t.redraw(e, () => {
|
|
5947
|
-
|
|
5965
|
+
L.draw(e, ii.material, {
|
|
5948
5966
|
sampler: 0,
|
|
5949
5967
|
saturation: this.saturation,
|
|
5950
5968
|
contrast: this.contrast,
|
|
@@ -5958,18 +5976,18 @@ var oi, W = class extends H {
|
|
|
5958
5976
|
});
|
|
5959
5977
|
}
|
|
5960
5978
|
};
|
|
5961
|
-
|
|
5979
|
+
k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "gamma", void 0), K = ii = k([x("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
5962
5980
|
//#endregion
|
|
5963
5981
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5964
|
-
var
|
|
5982
|
+
var ai, oi = class extends W {
|
|
5965
5983
|
static {
|
|
5966
|
-
|
|
5984
|
+
ai = this;
|
|
5967
5985
|
}
|
|
5968
|
-
static material = new
|
|
5986
|
+
static material = new I({ gl: {
|
|
5969
5987
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5970
5988
|
fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
|
|
5971
5989
|
} });
|
|
5972
|
-
_colorMatrix = new
|
|
5990
|
+
_colorMatrix = new Ot();
|
|
5973
5991
|
constructor(e, t = []) {
|
|
5974
5992
|
super(), this.setProperties(e).append(t);
|
|
5975
5993
|
}
|
|
@@ -5982,13 +6000,13 @@ var si, ci = class extends H {
|
|
|
5982
6000
|
}
|
|
5983
6001
|
apply(e, t) {
|
|
5984
6002
|
if (!this.filter) return;
|
|
5985
|
-
let n =
|
|
6003
|
+
let n = je(this.filter), r = this._colorMatrix.identity();
|
|
5986
6004
|
n.forEach(({ name: e, args: t }) => {
|
|
5987
6005
|
let n = t.map((e) => e.normalizedIntValue);
|
|
5988
6006
|
switch (e) {
|
|
5989
6007
|
case "hue-rotate":
|
|
5990
6008
|
case "hueRotate":
|
|
5991
|
-
r.hueRotate(n[0] *
|
|
6009
|
+
r.hueRotate(n[0] * Ce);
|
|
5992
6010
|
break;
|
|
5993
6011
|
case "saturate":
|
|
5994
6012
|
r.saturate(n[0]);
|
|
@@ -6013,25 +6031,25 @@ var si, ci = class extends H {
|
|
|
6013
6031
|
break;
|
|
6014
6032
|
}
|
|
6015
6033
|
}), t.redraw(e, () => {
|
|
6016
|
-
|
|
6034
|
+
L.draw(e, ai.material, {
|
|
6017
6035
|
sampler: 0,
|
|
6018
6036
|
m: r.toArray()
|
|
6019
6037
|
});
|
|
6020
6038
|
});
|
|
6021
6039
|
}
|
|
6022
6040
|
};
|
|
6023
|
-
|
|
6041
|
+
k([_(), O("design:type", String)], oi.prototype, "filter", void 0), oi = ai = k([x("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], oi);
|
|
6024
6042
|
//#endregion
|
|
6025
6043
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
6026
|
-
var
|
|
6044
|
+
var si, ci = 50, li = class extends W {
|
|
6027
6045
|
static {
|
|
6028
|
-
|
|
6046
|
+
si = this;
|
|
6029
6047
|
}
|
|
6030
|
-
static material = new
|
|
6048
|
+
static material = new I({ gl: {
|
|
6031
6049
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6032
6050
|
fragment: `precision mediump float;
|
|
6033
6051
|
uniform sampler2D sampler;
|
|
6034
|
-
uniform vec4 colors[${
|
|
6052
|
+
uniform vec4 colors[${ci}];
|
|
6035
6053
|
varying vec2 vUv;
|
|
6036
6054
|
|
|
6037
6055
|
float calcWidth() {
|
|
@@ -6040,7 +6058,7 @@ float calcWidth() {
|
|
|
6040
6058
|
|
|
6041
6059
|
int calcCount() {
|
|
6042
6060
|
int count = 0;
|
|
6043
|
-
for (int i = 0; i < ${
|
|
6061
|
+
for (int i = 0; i < ${ci}; i++) {
|
|
6044
6062
|
if (colors[i] != vec4(0,0,0,0)){
|
|
6045
6063
|
count++;
|
|
6046
6064
|
}
|
|
@@ -6052,7 +6070,7 @@ vec4 calcColor(float x) {
|
|
|
6052
6070
|
float perUnit = calcWidth() / float(calcCount());
|
|
6053
6071
|
int index = int(x / perUnit);
|
|
6054
6072
|
|
|
6055
|
-
for(int i=0; i<${
|
|
6073
|
+
for(int i=0; i<${ci}; i++){
|
|
6056
6074
|
if(i==index){
|
|
6057
6075
|
return colors[i];
|
|
6058
6076
|
}
|
|
@@ -6067,7 +6085,7 @@ void main(void) {
|
|
|
6067
6085
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
6068
6086
|
}`
|
|
6069
6087
|
} });
|
|
6070
|
-
_color = new
|
|
6088
|
+
_color = new T();
|
|
6071
6089
|
constructor(e, t = []) {
|
|
6072
6090
|
super(), this.setProperties(e).append(t);
|
|
6073
6091
|
}
|
|
@@ -6078,31 +6096,31 @@ void main(void) {
|
|
|
6078
6096
|
let t = this._color.toArray();
|
|
6079
6097
|
return t[3] = this.alpha, t;
|
|
6080
6098
|
});
|
|
6081
|
-
for (; t.length <
|
|
6099
|
+
for (; t.length < ci;) t.push([
|
|
6082
6100
|
0,
|
|
6083
6101
|
0,
|
|
6084
6102
|
0,
|
|
6085
6103
|
0
|
|
6086
6104
|
]);
|
|
6087
|
-
|
|
6105
|
+
L.draw(e, si.material, {
|
|
6088
6106
|
sampler: 0,
|
|
6089
|
-
colors: t.slice(0,
|
|
6107
|
+
colors: t.slice(0, ci).flatMap((e) => e)
|
|
6090
6108
|
});
|
|
6091
6109
|
});
|
|
6092
6110
|
}
|
|
6093
6111
|
};
|
|
6094
|
-
|
|
6112
|
+
k([_({ default: () => [] }), O("design:type", Array)], li.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], li.prototype, "alpha", void 0), li = si = k([x("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
|
|
6095
6113
|
//#endregion
|
|
6096
6114
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
6097
|
-
var
|
|
6115
|
+
var ui, di = class extends W {
|
|
6098
6116
|
static {
|
|
6099
|
-
|
|
6117
|
+
ui = this;
|
|
6100
6118
|
}
|
|
6101
|
-
static material = new
|
|
6119
|
+
static material = new I({ gl: {
|
|
6102
6120
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6103
6121
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
|
|
6104
6122
|
} });
|
|
6105
|
-
_color = new
|
|
6123
|
+
_color = new T();
|
|
6106
6124
|
constructor(e, t = []) {
|
|
6107
6125
|
super(), this.setProperties(e).append(t);
|
|
6108
6126
|
}
|
|
@@ -6116,7 +6134,7 @@ var fi, pi = class extends H {
|
|
|
6116
6134
|
r.slice(0, 50).forEach((e, t) => {
|
|
6117
6135
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
6118
6136
|
}), t.redraw(e, () => {
|
|
6119
|
-
|
|
6137
|
+
L.draw(e, ui.material, {
|
|
6120
6138
|
sampler: 0,
|
|
6121
6139
|
epsilon: this.epsilon,
|
|
6122
6140
|
originalColors: n
|
|
@@ -6124,19 +6142,19 @@ var fi, pi = class extends H {
|
|
|
6124
6142
|
});
|
|
6125
6143
|
}
|
|
6126
6144
|
};
|
|
6127
|
-
|
|
6145
|
+
k([_({ default: () => [] }), O("design:type", Array)], di.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], di.prototype, "epsilon", void 0), di = ui = k([x("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], di);
|
|
6128
6146
|
//#endregion
|
|
6129
6147
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
6130
|
-
var
|
|
6148
|
+
var fi, pi = 50, mi = class extends W {
|
|
6131
6149
|
static {
|
|
6132
|
-
|
|
6150
|
+
fi = this;
|
|
6133
6151
|
}
|
|
6134
|
-
static material = new
|
|
6152
|
+
static material = new I({ gl: {
|
|
6135
6153
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6136
6154
|
fragment: `varying vec2 vUv;
|
|
6137
6155
|
uniform sampler2D sampler;
|
|
6138
6156
|
uniform float epsilon;
|
|
6139
|
-
const int MAX_COLORS = ${
|
|
6157
|
+
const int MAX_COLORS = ${pi};
|
|
6140
6158
|
uniform vec3 originalColors[MAX_COLORS];
|
|
6141
6159
|
uniform vec3 targetColors[MAX_COLORS];
|
|
6142
6160
|
|
|
@@ -6164,7 +6182,7 @@ void main(void) {
|
|
|
6164
6182
|
}
|
|
6165
6183
|
}`
|
|
6166
6184
|
} });
|
|
6167
|
-
_color = new
|
|
6185
|
+
_color = new T();
|
|
6168
6186
|
constructor(e, t = []) {
|
|
6169
6187
|
super(), this.setProperties(e).append(t);
|
|
6170
6188
|
}
|
|
@@ -6173,8 +6191,8 @@ void main(void) {
|
|
|
6173
6191
|
this._color.value = e[0];
|
|
6174
6192
|
let t = this._color.toArray().slice(0, 3);
|
|
6175
6193
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
6176
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
6177
|
-
for (; n.length <
|
|
6194
|
+
}), r = this.epsilon, i = new Float32Array(pi * 3), a = new Float32Array(pi * 3);
|
|
6195
|
+
for (; n.length < pi;) n.push([[
|
|
6178
6196
|
-1,
|
|
6179
6197
|
0,
|
|
6180
6198
|
0
|
|
@@ -6184,10 +6202,10 @@ void main(void) {
|
|
|
6184
6202
|
0,
|
|
6185
6203
|
1
|
|
6186
6204
|
]]);
|
|
6187
|
-
n.slice(0,
|
|
6205
|
+
n.slice(0, pi).forEach(([e, t], n) => {
|
|
6188
6206
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
6189
6207
|
}), t.redraw(e, () => {
|
|
6190
|
-
|
|
6208
|
+
L.draw(e, fi.material, {
|
|
6191
6209
|
sampler: 0,
|
|
6192
6210
|
epsilon: r,
|
|
6193
6211
|
originalColors: i,
|
|
@@ -6196,19 +6214,19 @@ void main(void) {
|
|
|
6196
6214
|
});
|
|
6197
6215
|
}
|
|
6198
6216
|
};
|
|
6199
|
-
|
|
6217
|
+
k([_({ default: () => [] }), O("design:type", Array)], mi.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], mi.prototype, "epsilon", void 0), mi = fi = k([x("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
|
|
6200
6218
|
//#endregion
|
|
6201
6219
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
6202
|
-
var
|
|
6220
|
+
var hi = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\n// 背景底纹颜色(明暗由主题解析后传入,引擎不再区分 dark 变体):\n// checkerboardColor —— 底色(网格底格 / 点阵底)\n// checkerboardDotColor —— 点色(点阵的圆点)\nuniform vec3 checkerboardColor;\nuniform vec3 checkerboardDotColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\n// 远距淡出:缩放低于 DOT_FADE_END 起点阵开始渐隐,到 DOT_FADE_START 完全隐藏\n// (避免缩得很远时点糊成一片,Figma/FigJam/Miro 同法:点的可见度随 zoom 衰减)。\nconst float DOT_FADE_START = 0.04;\nconst float DOT_FADE_END = 0.10;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_DOTS = 2;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n vec3 bg;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n // 棋盘:两格用底色与其轻微压暗,保持细腻网格感(明暗全由 checkerboardColor 决定)。\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n bg = fractValue.x * fractValue.y < 0.0 ? checkerboardColor : checkerboardColor * 0.96;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS) {\n // 点阵:底色 checkerboardColor + 圆点 checkerboardDotColor(放大时按 dotColorDiff 提亮)。\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n vec3 dotColor = checkerboardDotColor + vec3(dotColorDiff * zoomInterpolationFactor);\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n // 远距淡出:zoomScale 越低点越淡,低于 DOT_FADE_START 完全隐去(回落到纯底色)。\n dist *= smoothstep(DOT_FADE_START, DOT_FADE_END, zoomScale);\n bg = mix(checkerboardColor, dotColor, dist);\n }\n else {\n bg = checkerboardColor;\n }\n return vec4(bg * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", gi, q = class extends W {
|
|
6203
6221
|
static {
|
|
6204
|
-
|
|
6222
|
+
gi = this;
|
|
6205
6223
|
}
|
|
6206
6224
|
_watermark;
|
|
6207
|
-
_color = new
|
|
6208
|
-
_dotColor = new
|
|
6209
|
-
static material = new
|
|
6225
|
+
_color = new T("#f2f3f5");
|
|
6226
|
+
_dotColor = new T("#c8ccd4");
|
|
6227
|
+
static material = new I({ gl: {
|
|
6210
6228
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6211
|
-
fragment:
|
|
6229
|
+
fragment: hi
|
|
6212
6230
|
} });
|
|
6213
6231
|
constructor(e, t = []) {
|
|
6214
6232
|
super(), this.setProperties(e).append(t);
|
|
@@ -6243,7 +6261,7 @@ var _i = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
6243
6261
|
t.redraw(e, () => {
|
|
6244
6262
|
this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
|
|
6245
6263
|
let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]), [a, o, s] = this._color.toArray(), [c, l, u] = this._dotColor.toArray();
|
|
6246
|
-
|
|
6264
|
+
L.draw(e, gi.material, {
|
|
6247
6265
|
uTexture: 0,
|
|
6248
6266
|
inputSize: [t.width, t.height],
|
|
6249
6267
|
zoom: [n[0], n[4]],
|
|
@@ -6275,20 +6293,20 @@ var _i = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
6275
6293
|
});
|
|
6276
6294
|
}
|
|
6277
6295
|
};
|
|
6278
|
-
|
|
6296
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], q.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "pixelGrid", void 0), k([_({ fallback: "#f2f3f5" }), O("design:type", String)], q.prototype, "checkerboardColor", void 0), k([_({ fallback: "#c8ccd4" }), O("design:type", String)], q.prototype, "checkerboardDotColor", void 0), k([_({ fallback: .06 }), O("design:type", Number)], q.prototype, "dotColorDiff", void 0), k([_(), O("design:type", String)], q.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], q.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], q.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], q.prototype, "watermarkRotation", void 0), q = gi = k([x("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6279
6297
|
//#endregion
|
|
6280
6298
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
6281
|
-
var
|
|
6299
|
+
var _i, vi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", yi = class extends W {
|
|
6282
6300
|
static {
|
|
6283
|
-
|
|
6301
|
+
_i = this;
|
|
6284
6302
|
}
|
|
6285
|
-
static materialX = new
|
|
6303
|
+
static materialX = new I({ gl: {
|
|
6286
6304
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
6287
|
-
fragment:
|
|
6305
|
+
fragment: vi
|
|
6288
6306
|
} });
|
|
6289
|
-
static materialY = new
|
|
6307
|
+
static materialY = new I({ gl: {
|
|
6290
6308
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
6291
|
-
fragment:
|
|
6309
|
+
fragment: vi
|
|
6292
6310
|
} });
|
|
6293
6311
|
constructor(e, t = []) {
|
|
6294
6312
|
super(), this.setProperties(e).append(t);
|
|
@@ -6296,39 +6314,39 @@ var yi, bi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
6296
6314
|
apply(e, t) {
|
|
6297
6315
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
6298
6316
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
6299
|
-
|
|
6317
|
+
L.draw(e, _i.materialX, {
|
|
6300
6318
|
sampler: 0,
|
|
6301
6319
|
uStrength: n * (this.strength / i)
|
|
6302
6320
|
});
|
|
6303
6321
|
});
|
|
6304
6322
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
6305
|
-
|
|
6323
|
+
L.draw(e, _i.materialY, {
|
|
6306
6324
|
sampler: 0,
|
|
6307
6325
|
uStrength: r * (this.strength / i)
|
|
6308
6326
|
});
|
|
6309
6327
|
});
|
|
6310
6328
|
}
|
|
6311
6329
|
};
|
|
6312
|
-
|
|
6330
|
+
k([_({ fallback: 4 }), O("design:type", Number)], yi.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], yi.prototype, "quality", void 0), yi = _i = k([x("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], yi);
|
|
6313
6331
|
//#endregion
|
|
6314
6332
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
6315
|
-
var
|
|
6333
|
+
var bi, xi = class extends W {
|
|
6316
6334
|
static {
|
|
6317
|
-
|
|
6335
|
+
bi = this;
|
|
6318
6336
|
}
|
|
6319
|
-
static material = new
|
|
6337
|
+
static material = new I({ gl: {
|
|
6320
6338
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6321
6339
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
6322
6340
|
} });
|
|
6323
|
-
blurEffect = new
|
|
6324
|
-
viewport3 = new
|
|
6325
|
-
_color = new
|
|
6341
|
+
blurEffect = new yi();
|
|
6342
|
+
viewport3 = new U();
|
|
6343
|
+
_color = new T();
|
|
6326
6344
|
constructor(e, t = []) {
|
|
6327
6345
|
super(), this.setProperties(e).append(t);
|
|
6328
6346
|
}
|
|
6329
6347
|
apply(e, t) {
|
|
6330
6348
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
6331
|
-
this._color.value = this.color,
|
|
6349
|
+
this._color.value = this.color, L.draw(e, bi.material, {
|
|
6332
6350
|
sampler: 0,
|
|
6333
6351
|
uAlpha: this._color.a,
|
|
6334
6352
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6341,18 +6359,18 @@ var Si, Ci = class extends H {
|
|
|
6341
6359
|
]
|
|
6342
6360
|
});
|
|
6343
6361
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
6344
|
-
this.viewport3.texture.activate(e, 1),
|
|
6362
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, mr.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, mr.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
6345
6363
|
});
|
|
6346
6364
|
}
|
|
6347
6365
|
};
|
|
6348
|
-
|
|
6366
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], xi.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], xi.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], xi.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], xi.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xi.prototype, "shadowOnly", void 0), xi = bi = k([x("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], xi);
|
|
6349
6367
|
//#endregion
|
|
6350
6368
|
//#region src/scene/effects/EmbossEffect.ts
|
|
6351
|
-
var
|
|
6369
|
+
var Si, Ci = class extends W {
|
|
6352
6370
|
static {
|
|
6353
|
-
|
|
6371
|
+
Si = this;
|
|
6354
6372
|
}
|
|
6355
|
-
static material = new
|
|
6373
|
+
static material = new I({ gl: {
|
|
6356
6374
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6357
6375
|
fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
|
|
6358
6376
|
} });
|
|
@@ -6361,7 +6379,7 @@ var wi, Ti = class extends H {
|
|
|
6361
6379
|
}
|
|
6362
6380
|
apply(e, t) {
|
|
6363
6381
|
t.redraw(e, () => {
|
|
6364
|
-
|
|
6382
|
+
L.draw(e, Si.material, {
|
|
6365
6383
|
sampler: 0,
|
|
6366
6384
|
strength: this.strength,
|
|
6367
6385
|
inputSize: [
|
|
@@ -6374,14 +6392,14 @@ var wi, Ti = class extends H {
|
|
|
6374
6392
|
});
|
|
6375
6393
|
}
|
|
6376
6394
|
};
|
|
6377
|
-
|
|
6395
|
+
k([_({ fallback: 5 }), O("design:type", Number)], Ci.prototype, "strength", void 0), Ci = Si = k([x("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ci);
|
|
6378
6396
|
//#endregion
|
|
6379
6397
|
//#region src/scene/effects/GlitchEffect.ts
|
|
6380
|
-
var
|
|
6398
|
+
var wi, J = class extends W {
|
|
6381
6399
|
static {
|
|
6382
|
-
|
|
6400
|
+
wi = this;
|
|
6383
6401
|
}
|
|
6384
|
-
static material = new
|
|
6402
|
+
static material = new I({ gl: {
|
|
6385
6403
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6386
6404
|
fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
|
|
6387
6405
|
} });
|
|
@@ -6392,9 +6410,9 @@ var Ei, K = class extends H {
|
|
|
6392
6410
|
_needsRedraw = !1;
|
|
6393
6411
|
constructor(e, t = []) {
|
|
6394
6412
|
super(), this.setProperties(e).append(t);
|
|
6395
|
-
let n =
|
|
6413
|
+
let n = C(4, this.sampleSize);
|
|
6396
6414
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
6397
|
-
this._canvas = n, this._texture = new
|
|
6415
|
+
this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6398
6416
|
}
|
|
6399
6417
|
redraw() {
|
|
6400
6418
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -6411,7 +6429,7 @@ var Ei, K = class extends H {
|
|
|
6411
6429
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6412
6430
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
6413
6431
|
t.redraw(e, () => {
|
|
6414
|
-
this._texture.activate(e, 1),
|
|
6432
|
+
this._texture.activate(e, 1), L.draw(e, wi.material, {
|
|
6415
6433
|
sampler: 0,
|
|
6416
6434
|
filterClamp: [
|
|
6417
6435
|
0,
|
|
@@ -6440,14 +6458,14 @@ var Ei, K = class extends H {
|
|
|
6440
6458
|
});
|
|
6441
6459
|
}
|
|
6442
6460
|
};
|
|
6443
|
-
|
|
6461
|
+
k([_({ fallback: 10 }), O("design:type", Number)], J.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], J.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], J.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], J.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], J.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], J.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], J.prototype, "blue", void 0), J = wi = k([x("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6444
6462
|
//#endregion
|
|
6445
6463
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6446
|
-
var
|
|
6464
|
+
var Ti, Ei = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", Di = class extends W {
|
|
6447
6465
|
static {
|
|
6448
|
-
|
|
6466
|
+
Ti = this;
|
|
6449
6467
|
}
|
|
6450
|
-
static material = new
|
|
6468
|
+
static material = new I({ gl: {
|
|
6451
6469
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6452
6470
|
fragment: `precision highp float;
|
|
6453
6471
|
varying vec2 vUv;
|
|
@@ -6460,7 +6478,7 @@ uniform float uTime;
|
|
|
6460
6478
|
uniform vec3 uRay;
|
|
6461
6479
|
uniform vec4 uInputSize;
|
|
6462
6480
|
|
|
6463
|
-
${
|
|
6481
|
+
${Ei}
|
|
6464
6482
|
|
|
6465
6483
|
void main(void) {
|
|
6466
6484
|
bool uParallel = uParallel > 0.5;
|
|
@@ -6499,7 +6517,7 @@ void main(void) {
|
|
|
6499
6517
|
apply(e, t) {
|
|
6500
6518
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6501
6519
|
t.redraw(e, () => {
|
|
6502
|
-
|
|
6520
|
+
L.draw(e, Ti.material, {
|
|
6503
6521
|
sampler: 0,
|
|
6504
6522
|
uDimensions: [t.width, t.height],
|
|
6505
6523
|
uParallel: +!!this.parallel,
|
|
@@ -6521,15 +6539,15 @@ void main(void) {
|
|
|
6521
6539
|
});
|
|
6522
6540
|
}
|
|
6523
6541
|
};
|
|
6524
|
-
|
|
6542
|
+
k([_({ fallback: 0 }), O("design:type", Number)], Di.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], Di.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Di.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], Di.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], Di.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], Di.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Di.prototype, "alpha", void 0), Di = Ti = k([x("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Di);
|
|
6525
6543
|
//#endregion
|
|
6526
6544
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6527
|
-
var
|
|
6545
|
+
var Oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", ki = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", Ai = class extends W {
|
|
6528
6546
|
_kernels = [0];
|
|
6529
6547
|
constructor(e, t = []) {
|
|
6530
|
-
super(), this.material = new
|
|
6548
|
+
super(), this.material = new I({ gl: {
|
|
6531
6549
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6532
|
-
fragment: e?.clamp ?
|
|
6550
|
+
fragment: e?.clamp ? ki : Oi
|
|
6533
6551
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6534
6552
|
}
|
|
6535
6553
|
_updateProperty(e, t, n) {
|
|
@@ -6553,7 +6571,7 @@ var Ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6553
6571
|
this._kernels.forEach((i) => {
|
|
6554
6572
|
let a = i + .5;
|
|
6555
6573
|
t.redraw(e, () => {
|
|
6556
|
-
|
|
6574
|
+
L.draw(e, this.material, {
|
|
6557
6575
|
sampler: 0,
|
|
6558
6576
|
uOffset: [a * n, a * r],
|
|
6559
6577
|
uInputClamp: [
|
|
@@ -6567,14 +6585,14 @@ var Ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6567
6585
|
});
|
|
6568
6586
|
}
|
|
6569
6587
|
};
|
|
6570
|
-
|
|
6588
|
+
k([_({ fallback: 4 }), O("design:type", Number)], Ai.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Ai.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], Ai.prototype, "pixelSize", void 0), Ai = k([x("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ai);
|
|
6571
6589
|
//#endregion
|
|
6572
6590
|
//#region src/scene/effects/MaskEffect.ts
|
|
6573
|
-
var
|
|
6591
|
+
var ji, Mi = class extends W {
|
|
6574
6592
|
static {
|
|
6575
|
-
|
|
6593
|
+
ji = this;
|
|
6576
6594
|
}
|
|
6577
|
-
static material = new
|
|
6595
|
+
static material = new I({ gl: {
|
|
6578
6596
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6579
6597
|
fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
|
|
6580
6598
|
} });
|
|
@@ -6594,7 +6612,7 @@ var Ni, Pi = class extends H {
|
|
|
6594
6612
|
}
|
|
6595
6613
|
apply(e, t, n) {
|
|
6596
6614
|
this.texture && t.redraw(e, () => {
|
|
6597
|
-
this.texture.activate(e, 1),
|
|
6615
|
+
this.texture.activate(e, 1), L.draw(e, ji.material, {
|
|
6598
6616
|
sampler: 0,
|
|
6599
6617
|
mask: 1,
|
|
6600
6618
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6602,33 +6620,33 @@ var Ni, Pi = class extends H {
|
|
|
6602
6620
|
});
|
|
6603
6621
|
}
|
|
6604
6622
|
};
|
|
6605
|
-
|
|
6623
|
+
k([_({ fallback: "" }), O("design:type", String)], Mi.prototype, "image", void 0), Mi = ji = k([x("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Mi);
|
|
6606
6624
|
//#endregion
|
|
6607
6625
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6608
|
-
var
|
|
6626
|
+
var Ni, Pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", Fi = class extends W {
|
|
6609
6627
|
static {
|
|
6610
|
-
|
|
6628
|
+
Ni = this;
|
|
6611
6629
|
}
|
|
6612
6630
|
static MIN_SAMPLES = 1;
|
|
6613
6631
|
static MAX_SAMPLES = 100;
|
|
6614
6632
|
static getAngleStep(e) {
|
|
6615
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6633
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * Ni.MAX_SAMPLES, Ni.MIN_SAMPLES)).toFixed(7));
|
|
6616
6634
|
}
|
|
6617
|
-
_color = new
|
|
6635
|
+
_color = new T();
|
|
6618
6636
|
constructor(e, t = []) {
|
|
6619
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6637
|
+
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6620
6638
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6621
|
-
fragment:
|
|
6639
|
+
fragment: Pi.replace(/\{ANGLE_STEP\}/, Ni.getAngleStep(this.quality).toFixed(7))
|
|
6622
6640
|
} });
|
|
6623
6641
|
}
|
|
6624
6642
|
apply(e, t) {
|
|
6625
6643
|
t.redraw(e, () => {
|
|
6626
|
-
this._color.value = this.color,
|
|
6644
|
+
this._color.value = this.color, L.draw(e, this.material, {
|
|
6627
6645
|
sampler: 0,
|
|
6628
6646
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6629
6647
|
uColor: this._color.toArray().slice(0, 3),
|
|
6630
6648
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6631
|
-
uAngleStep:
|
|
6649
|
+
uAngleStep: Ni.getAngleStep(this.quality),
|
|
6632
6650
|
uKnockout: +!!this.knockout,
|
|
6633
6651
|
uInputClamp: [
|
|
6634
6652
|
0,
|
|
@@ -6640,14 +6658,14 @@ var Fi, Ii = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6640
6658
|
});
|
|
6641
6659
|
}
|
|
6642
6660
|
};
|
|
6643
|
-
|
|
6661
|
+
k([_({ fallback: "#000000ff" }), O("design:type", Object)], Fi.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Fi.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], Fi.prototype, "style", void 0), k([_(), O("design:type", Object)], Fi.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Fi.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Fi.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Fi.prototype, "knockout", void 0), Fi = Ni = k([x("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Fi);
|
|
6644
6662
|
//#endregion
|
|
6645
6663
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6646
|
-
var
|
|
6664
|
+
var Ii, Li = class extends W {
|
|
6647
6665
|
static {
|
|
6648
|
-
|
|
6666
|
+
Ii = this;
|
|
6649
6667
|
}
|
|
6650
|
-
static material = new
|
|
6668
|
+
static material = new I({ gl: {
|
|
6651
6669
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6652
6670
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
|
|
6653
6671
|
} });
|
|
@@ -6661,18 +6679,18 @@ var Ri, zi = class extends H {
|
|
|
6661
6679
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6662
6680
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6663
6681
|
};
|
|
6664
|
-
|
|
6682
|
+
L.draw(e, Ii.material, a);
|
|
6665
6683
|
});
|
|
6666
6684
|
}
|
|
6667
6685
|
};
|
|
6668
|
-
|
|
6686
|
+
k([_({ fallback: 10 }), O("design:type", Number)], Li.prototype, "strength", void 0), Li = Ii = k([x("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Li);
|
|
6669
6687
|
//#endregion
|
|
6670
6688
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6671
|
-
var
|
|
6689
|
+
var Ri, zi = class extends W {
|
|
6672
6690
|
static {
|
|
6673
|
-
|
|
6691
|
+
Ri = this;
|
|
6674
6692
|
}
|
|
6675
|
-
static material = new
|
|
6693
|
+
static material = new I({ gl: {
|
|
6676
6694
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6677
6695
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
|
|
6678
6696
|
} });
|
|
@@ -6681,7 +6699,7 @@ var Bi, Vi = class extends H {
|
|
|
6681
6699
|
}
|
|
6682
6700
|
apply(e, t) {
|
|
6683
6701
|
t.redraw(e, () => {
|
|
6684
|
-
|
|
6702
|
+
L.draw(e, Ri.material, {
|
|
6685
6703
|
sampler: 0,
|
|
6686
6704
|
uCenter: [t.width / 2, t.height / 2],
|
|
6687
6705
|
uInnerRadius: this.innerRadius,
|
|
@@ -6697,10 +6715,10 @@ var Bi, Vi = class extends H {
|
|
|
6697
6715
|
});
|
|
6698
6716
|
}
|
|
6699
6717
|
};
|
|
6700
|
-
|
|
6718
|
+
k([_(), O("design:type", Array)], zi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], zi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], zi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], zi.prototype, "strength", void 0), zi = Ri = k([x("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zi);
|
|
6701
6719
|
//#endregion
|
|
6702
6720
|
//#region src/scene/2d/element/utils.ts
|
|
6703
|
-
function
|
|
6721
|
+
function Bi(e, t) {
|
|
6704
6722
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6705
6723
|
if (e.cropRect) {
|
|
6706
6724
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6715,6 +6733,7 @@ function Hi(e, t) {
|
|
|
6715
6733
|
let { a: c, c: l, tx: u, b: d, d: f, ty: p } = s, m, h;
|
|
6716
6734
|
return {
|
|
6717
6735
|
clipOutsideUv: o,
|
|
6736
|
+
clampTexture: !!e.cropRect || !e.tile,
|
|
6718
6737
|
transformUv: (e, t) => {
|
|
6719
6738
|
m = e[t], h = e[t + 1], e[t] = c * m + l * h + u, e[t + 1] = d * m + f * h + p;
|
|
6720
6739
|
}
|
|
@@ -6722,7 +6741,7 @@ function Hi(e, t) {
|
|
|
6722
6741
|
}
|
|
6723
6742
|
//#endregion
|
|
6724
6743
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6725
|
-
var
|
|
6744
|
+
var Y = class extends w {
|
|
6726
6745
|
_parent;
|
|
6727
6746
|
texture;
|
|
6728
6747
|
animatedTexture;
|
|
@@ -6756,7 +6775,7 @@ var q = class extends C {
|
|
|
6756
6775
|
}
|
|
6757
6776
|
}
|
|
6758
6777
|
async loadTexture() {
|
|
6759
|
-
if (this.linearGradient || this.radialGradient) this.texture = new
|
|
6778
|
+
if (this.linearGradient || this.radialGradient) this.texture = new wr(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
|
|
6760
6779
|
else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
|
|
6761
6780
|
else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
|
|
6762
6781
|
let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
|
|
@@ -6775,7 +6794,7 @@ var q = class extends C {
|
|
|
6775
6794
|
let i = await n(t, r);
|
|
6776
6795
|
if (i) return this._pipelineImageToCanvas(i);
|
|
6777
6796
|
});
|
|
6778
|
-
r && (this.texture = new
|
|
6797
|
+
r && (this.texture = new z({
|
|
6779
6798
|
source: r,
|
|
6780
6799
|
width: r.width,
|
|
6781
6800
|
height: r.height,
|
|
@@ -6786,15 +6805,15 @@ var q = class extends C {
|
|
|
6786
6805
|
return e.map((e) => `${e.name}:${e.params ? JSON.stringify(e.params) : ""}`).join("|");
|
|
6787
6806
|
}
|
|
6788
6807
|
async _decodePipelineSource(e) {
|
|
6789
|
-
let t = await $.fetchImageBitmap(e), n = Math.max(1, Math.round(t.width)), r = Math.max(1, Math.round(t.height)), i =
|
|
6790
|
-
if (!(!i || !a)) return a.drawImage(t, 0, 0, n, r),
|
|
6808
|
+
let t = await $.fetchImageBitmap(e), n = Math.max(1, Math.round(t.width)), r = Math.max(1, Math.round(t.height)), i = C(n, r), a = i?.getContext("2d");
|
|
6809
|
+
if (!(!i || !a)) return a.drawImage(t, 0, 0, n, r), Fe && t instanceof ImageBitmap && t.close(), {
|
|
6791
6810
|
data: a.getImageData(0, 0, n, r).data,
|
|
6792
6811
|
width: n,
|
|
6793
6812
|
height: r
|
|
6794
6813
|
};
|
|
6795
6814
|
}
|
|
6796
6815
|
_pipelineImageToCanvas(e) {
|
|
6797
|
-
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r =
|
|
6816
|
+
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = C(t, n), i = r?.getContext("2d");
|
|
6798
6817
|
if (!r || !i) return;
|
|
6799
6818
|
let a = i.createImageData(t, n);
|
|
6800
6819
|
return a.data.set(e.data), i.putImageData(a, 0, 0), r;
|
|
@@ -6813,12 +6832,12 @@ var q = class extends C {
|
|
|
6813
6832
|
width: e,
|
|
6814
6833
|
height: t
|
|
6815
6834
|
} };
|
|
6816
|
-
if (this.image === "viewport") n.fillStyle = new
|
|
6835
|
+
if (this.image === "viewport") n.fillStyle = new Or();
|
|
6817
6836
|
else {
|
|
6818
6837
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6819
6838
|
r = {
|
|
6820
6839
|
...r,
|
|
6821
|
-
...
|
|
6840
|
+
...Bi(this, this.tile && i ? {
|
|
6822
6841
|
x: 0,
|
|
6823
6842
|
y: 0,
|
|
6824
6843
|
width: i.sourceWidth,
|
|
@@ -6854,10 +6873,10 @@ var q = class extends C {
|
|
|
6854
6873
|
this.updateFrameIndex();
|
|
6855
6874
|
}
|
|
6856
6875
|
};
|
|
6857
|
-
|
|
6876
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0), k([_(), O("design:type", Object)], Y.prototype, "imagePipelines", void 0);
|
|
6858
6877
|
//#endregion
|
|
6859
6878
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6860
|
-
var
|
|
6879
|
+
var Vi = class extends Y {
|
|
6861
6880
|
setProperties(e) {
|
|
6862
6881
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6863
6882
|
}
|
|
@@ -6869,14 +6888,14 @@ var Ui = class extends q {
|
|
|
6869
6888
|
}
|
|
6870
6889
|
}
|
|
6871
6890
|
};
|
|
6872
|
-
|
|
6891
|
+
k([_(), O("design:type", Object)], Vi.prototype, "fillWithShape", void 0);
|
|
6873
6892
|
//#endregion
|
|
6874
6893
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6875
|
-
var
|
|
6876
|
-
function
|
|
6877
|
-
return
|
|
6894
|
+
var Hi;
|
|
6895
|
+
function Ui() {
|
|
6896
|
+
return Hi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Hi;
|
|
6878
6897
|
}
|
|
6879
|
-
function
|
|
6898
|
+
function Wi(e) {
|
|
6880
6899
|
if (!e) return { show: !1 };
|
|
6881
6900
|
switch (e) {
|
|
6882
6901
|
case "bottom": return {
|
|
@@ -6899,7 +6918,7 @@ function Ki(e) {
|
|
|
6899
6918
|
};
|
|
6900
6919
|
}
|
|
6901
6920
|
}
|
|
6902
|
-
var
|
|
6921
|
+
var Gi = class extends w {
|
|
6903
6922
|
_parent;
|
|
6904
6923
|
_instance;
|
|
6905
6924
|
_container;
|
|
@@ -6942,7 +6961,7 @@ var J = class extends C {
|
|
|
6942
6961
|
this._teardown(), this._parent.requestDraw();
|
|
6943
6962
|
return;
|
|
6944
6963
|
}
|
|
6945
|
-
let n = await
|
|
6964
|
+
let n = await Ui();
|
|
6946
6965
|
if (!n) {
|
|
6947
6966
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6948
6967
|
return;
|
|
@@ -6967,7 +6986,7 @@ var J = class extends C {
|
|
|
6967
6986
|
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6968
6987
|
let e = this._container.querySelector("canvas");
|
|
6969
6988
|
if (!e) return;
|
|
6970
|
-
this._texture = new
|
|
6989
|
+
this._texture = new _r({
|
|
6971
6990
|
source: e,
|
|
6972
6991
|
pixelRatio: 1
|
|
6973
6992
|
});
|
|
@@ -6980,7 +6999,7 @@ var J = class extends C {
|
|
|
6980
6999
|
let n = document.createElement("canvas");
|
|
6981
7000
|
n.width = Math.ceil(e), n.height = Math.ceil(t);
|
|
6982
7001
|
let r = n.getContext("2d");
|
|
6983
|
-
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new
|
|
7002
|
+
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new _r({
|
|
6984
7003
|
source: n,
|
|
6985
7004
|
pixelRatio: 1
|
|
6986
7005
|
}), this._texture.requestUpdate("source"), this._parent.requestDraw());
|
|
@@ -7001,7 +7020,7 @@ var J = class extends C {
|
|
|
7001
7020
|
text: this.title,
|
|
7002
7021
|
left: "center"
|
|
7003
7022
|
} : void 0,
|
|
7004
|
-
legend:
|
|
7023
|
+
legend: Wi(this.legend),
|
|
7005
7024
|
tooltip: {}
|
|
7006
7025
|
};
|
|
7007
7026
|
if (n) {
|
|
@@ -7045,10 +7064,10 @@ var J = class extends C {
|
|
|
7045
7064
|
this._teardown();
|
|
7046
7065
|
}
|
|
7047
7066
|
};
|
|
7048
|
-
|
|
7067
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Gi.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], Gi.prototype, "type", void 0), k([_(), O("design:type", Object)], Gi.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Gi.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Gi.prototype, "series", void 0), k([_(), O("design:type", Object)], Gi.prototype, "title", void 0), k([_(), O("design:type", Object)], Gi.prototype, "legend", void 0), k([_(), O("design:type", Object)], Gi.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], Gi.prototype, "valueAxis", void 0);
|
|
7049
7068
|
//#endregion
|
|
7050
7069
|
//#region src/scene/2d/element/Element2DComments.ts
|
|
7051
|
-
var
|
|
7070
|
+
var Ki = class extends w {
|
|
7052
7071
|
parent;
|
|
7053
7072
|
constructor(e) {
|
|
7054
7073
|
super(), this.parent = e;
|
|
@@ -7082,12 +7101,12 @@ var qi = class extends C {
|
|
|
7082
7101
|
isValid() {
|
|
7083
7102
|
return Object.values(this._properties).some(Boolean);
|
|
7084
7103
|
}
|
|
7085
|
-
},
|
|
7104
|
+
}, qi = 8, Ji = class extends w {
|
|
7086
7105
|
_parent;
|
|
7087
7106
|
_routeSig;
|
|
7088
7107
|
_routePath;
|
|
7089
7108
|
_keyTargets = [void 0, void 0];
|
|
7090
|
-
_routeKey = Array.from({ length:
|
|
7109
|
+
_routeKey = Array.from({ length: qi * 2 }, () => NaN);
|
|
7091
7110
|
_keyMode;
|
|
7092
7111
|
_keyAnchors = [
|
|
7093
7112
|
void 0,
|
|
@@ -7128,7 +7147,7 @@ var qi = class extends C {
|
|
|
7128
7147
|
return e?.id ? this._parent.tree?.getNodeById(e.id) : void 0;
|
|
7129
7148
|
}
|
|
7130
7149
|
_refreshTargets() {
|
|
7131
|
-
let e =
|
|
7150
|
+
let e = dt(), t = this.start?.id, n = this.end?.id;
|
|
7132
7151
|
this._targetsRevision === e && this._targetsStartId === t && this._targetsEndId === n || (this._targetsRevision = e, this._targetsStartId = t, this._targetsEndId = n, this._startTarget = this._resolveTarget(this.start), this._endTarget = this._resolveTarget(this.end));
|
|
7133
7152
|
}
|
|
7134
7153
|
_anchorsMatch() {
|
|
@@ -7143,14 +7162,14 @@ var qi = class extends C {
|
|
|
7143
7162
|
_writeKey(e, t) {
|
|
7144
7163
|
let n = this._routeKey;
|
|
7145
7164
|
if (!e) {
|
|
7146
|
-
n.fill(-1, t, t +
|
|
7165
|
+
n.fill(-1, t, t + qi);
|
|
7147
7166
|
return;
|
|
7148
7167
|
}
|
|
7149
7168
|
let r = e.globalAabb;
|
|
7150
7169
|
n[t] = e.transformDirtyId ?? -1, n[t + 1] = e.size?.x ?? -1, n[t + 2] = e.size?.y ?? -1, n[t + 3] = e.shape?.connectionPointsDirtyId ?? -1, n[t + 4] = r?.min.x ?? -1, n[t + 5] = r?.min.y ?? -1, n[t + 6] = r?.size.x ?? -1, n[t + 7] = r?.size.y ?? -1;
|
|
7151
7170
|
}
|
|
7152
7171
|
_storeKey(e, t) {
|
|
7153
|
-
this._writeKey(e, 0), this._writeKey(t,
|
|
7172
|
+
this._writeKey(e, 0), this._writeKey(t, qi), this._keyTargets[0] = e, this._keyTargets[1] = t, this._keyMode = this.mode, this._keyAnchors[0] = this.start?.id, this._keyAnchors[1] = this.start?.idx, this._keyAnchors[2] = this.end?.id, this._keyAnchors[3] = this.end?.idx, this._keyRevision = dt(), this._keyValid = !0;
|
|
7154
7173
|
}
|
|
7155
7174
|
resolveAnchor(e) {
|
|
7156
7175
|
return this.resolveEndpoint(e)?.point;
|
|
@@ -7171,12 +7190,12 @@ var qi = class extends C {
|
|
|
7171
7190
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
7172
7191
|
if (n) {
|
|
7173
7192
|
let e = t.globalTransform.apply(new y(n.x * t.size.x, n.y * t.size.y)), i;
|
|
7174
|
-
return i = n.ang === void 0 ?
|
|
7193
|
+
return i = n.ang === void 0 ? Jr(n.x - .5, n.y - .5) : {
|
|
7175
7194
|
x: Math.cos(n.ang),
|
|
7176
7195
|
y: Math.sin(n.ang)
|
|
7177
7196
|
}, {
|
|
7178
7197
|
point: e,
|
|
7179
|
-
dir:
|
|
7198
|
+
dir: Yi(i, t.globalRotation),
|
|
7180
7199
|
bbox: r
|
|
7181
7200
|
};
|
|
7182
7201
|
}
|
|
@@ -7193,21 +7212,21 @@ var qi = class extends C {
|
|
|
7193
7212
|
return e.getPointAt(t);
|
|
7194
7213
|
}
|
|
7195
7214
|
route() {
|
|
7196
|
-
if (this._keyValid && this._keyRevision ===
|
|
7215
|
+
if (this._keyValid && this._keyRevision === dt() && this._anchorsMatch()) return this._routePath;
|
|
7197
7216
|
this._refreshTargets();
|
|
7198
7217
|
let e = this._startTarget, t = this._endTarget;
|
|
7199
|
-
if (this._keyValid && this._anchorsMatch() && e === this._keyTargets[0] && t === this._keyTargets[1] && this._keyMatches(e, 0) && this._keyMatches(t,
|
|
7218
|
+
if (this._keyValid && this._anchorsMatch() && e === this._keyTargets[0] && t === this._keyTargets[1] && this._keyMatches(e, 0) && this._keyMatches(t, qi)) return this._keyRevision = dt(), this._routePath;
|
|
7200
7219
|
let n = this.resolveEndpoint(this.start, e), r = this.resolveEndpoint(this.end, t);
|
|
7201
7220
|
if (this._storeKey(e, t), !n && !r) {
|
|
7202
7221
|
this._routeSig = void 0, this._routePath = void 0;
|
|
7203
7222
|
return;
|
|
7204
7223
|
}
|
|
7205
7224
|
let i = (e) => e ? `${e.point.x},${e.point.y},${e.dir?.x ?? ""},${e.dir?.y ?? ""}` : "-", a = `${this.mode}|${i(n)}|${i(r)}`;
|
|
7206
|
-
return (a !== this._routeSig || !this._routePath) && (this._routeSig = a, this._routePath =
|
|
7225
|
+
return (a !== this._routeSig || !this._routePath) && (this._routeSig = a, this._routePath = Yr(this.mode, n ?? r, r ?? n)), this._routePath;
|
|
7207
7226
|
}
|
|
7208
7227
|
};
|
|
7209
|
-
|
|
7210
|
-
function
|
|
7228
|
+
k([_(), O("design:type", Object)], Ji.prototype, "start", void 0), k([_(), O("design:type", Object)], Ji.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Ji.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ji.prototype, "labelPosition", void 0);
|
|
7229
|
+
function Yi(e, t) {
|
|
7211
7230
|
if (!t) return e;
|
|
7212
7231
|
let n = Math.cos(t), r = Math.sin(t);
|
|
7213
7232
|
return {
|
|
@@ -7217,7 +7236,7 @@ function Xi(e, t) {
|
|
|
7217
7236
|
}
|
|
7218
7237
|
//#endregion
|
|
7219
7238
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
7220
|
-
var
|
|
7239
|
+
var Xi = class extends Y {
|
|
7221
7240
|
setProperties(e) {
|
|
7222
7241
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
7223
7242
|
}
|
|
@@ -7225,14 +7244,14 @@ var Zi = class extends q {
|
|
|
7225
7244
|
super._updateProperty(e, t, n), e === "fillWithShape" && this._parent.requestDraw();
|
|
7226
7245
|
}
|
|
7227
7246
|
};
|
|
7228
|
-
|
|
7247
|
+
k([_(), O("design:type", Object)], Xi.prototype, "fillWithShape", void 0);
|
|
7229
7248
|
//#endregion
|
|
7230
7249
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
7231
|
-
var
|
|
7250
|
+
var Zi = {
|
|
7232
7251
|
sm: 4,
|
|
7233
7252
|
md: 6,
|
|
7234
7253
|
lg: 8
|
|
7235
|
-
},
|
|
7254
|
+
}, Qi = class extends Y {
|
|
7236
7255
|
setProperties(e) {
|
|
7237
7256
|
return super._setProperties(d(e) ? void 0 : te(e));
|
|
7238
7257
|
}
|
|
@@ -7259,7 +7278,7 @@ var Qi = {
|
|
|
7259
7278
|
}
|
|
7260
7279
|
draw() {
|
|
7261
7280
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
7262
|
-
this.image === "viewport" ? n.strokeStyle = new
|
|
7281
|
+
this.image === "viewport" ? n.strokeStyle = new Or() : n.strokeStyle = this.texture ?? this._resolveThemeColor(this.color) ?? "#000000FF", n.lineWidth = (this.width || 1) * (this.widthBoost || 1), n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.lineFlow = this.flow, n.stroke({ ...Bi(this, {
|
|
7263
7282
|
x: 0,
|
|
7264
7283
|
y: 0,
|
|
7265
7284
|
width: e,
|
|
@@ -7282,7 +7301,7 @@ var Qi = {
|
|
|
7282
7301
|
_fillEnd(e, t, n, r, i) {
|
|
7283
7302
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
7284
7303
|
if (s < .001) return;
|
|
7285
|
-
let c = a / s, l = o / s, u =
|
|
7304
|
+
let c = a / s, l = o / s, u = Zi[String(n.width ?? n.height ?? "md")] ?? 6, d = this._parent.context, f = this._resolveThemeColor(n.color) ?? i;
|
|
7286
7305
|
if (n.type === "bar") {
|
|
7287
7306
|
let t = r * u * .6, n = Math.max(r * .9, 1.5), i = 0, a = 0;
|
|
7288
7307
|
Math.abs(c) >= Math.abs(l) ? i = Math.sign(c) || 1 : a = Math.sign(l) || 1;
|
|
@@ -7294,10 +7313,10 @@ var Qi = {
|
|
|
7294
7313
|
d.fillStyle = f, d.moveTo(e.x, e.y).lineTo(h + ee, g + te).lineTo(h - ee, g - te).closePath().fill();
|
|
7295
7314
|
}
|
|
7296
7315
|
};
|
|
7297
|
-
|
|
7316
|
+
k([_(), O("design:type", Object)], Qi.prototype, "color", void 0), k([_(), O("design:type", Object)], Qi.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Qi.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Qi.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Qi.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Qi.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Qi.prototype, "tailEnd", void 0), k([_({ internal: !0 }), O("design:type", Number)], Qi.prototype, "flow", void 0), k([_({ internal: !0 }), O("design:type", Number)], Qi.prototype, "widthBoost", void 0);
|
|
7298
7317
|
//#endregion
|
|
7299
7318
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
7300
|
-
var $i = class extends
|
|
7319
|
+
var $i = class extends w {
|
|
7301
7320
|
_parent;
|
|
7302
7321
|
constructor(e) {
|
|
7303
7322
|
super(), this._parent = e;
|
|
@@ -7318,13 +7337,13 @@ var $i = class extends C {
|
|
|
7318
7337
|
}
|
|
7319
7338
|
updateEffect() {
|
|
7320
7339
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
7321
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
7340
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new xi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
7322
7341
|
}
|
|
7323
7342
|
};
|
|
7324
|
-
|
|
7343
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], $i.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], $i.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], $i.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], $i.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], $i.prototype, "offsetX", void 0);
|
|
7325
7344
|
//#endregion
|
|
7326
7345
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
7327
|
-
var ea = class extends
|
|
7346
|
+
var ea = class extends w {
|
|
7328
7347
|
_parent;
|
|
7329
7348
|
connectionPointsDirtyId = 0;
|
|
7330
7349
|
_path2DSet = new de();
|
|
@@ -7353,7 +7372,7 @@ var ea = class extends C {
|
|
|
7353
7372
|
this._updatePath2DSet(), this._parent.requestDraw();
|
|
7354
7373
|
break;
|
|
7355
7374
|
case "connectionPoints":
|
|
7356
|
-
this.connectionPointsDirtyId++,
|
|
7375
|
+
this.connectionPointsDirtyId++, ft();
|
|
7357
7376
|
break;
|
|
7358
7377
|
}
|
|
7359
7378
|
}
|
|
@@ -7427,10 +7446,10 @@ var ea = class extends C {
|
|
|
7427
7446
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7428
7447
|
}
|
|
7429
7448
|
};
|
|
7430
|
-
|
|
7449
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], ea.prototype, "enabled", void 0), k([_(), O("design:type", Object)], ea.prototype, "preset", void 0), k([_(), O("design:type", Object)], ea.prototype, "svg", void 0), k([_(), O("design:type", Object)], ea.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], ea.prototype, "paths", void 0), k([_(), O("design:type", Object)], ea.prototype, "connectionPoints", void 0);
|
|
7431
7450
|
//#endregion
|
|
7432
7451
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7433
|
-
var ta = class extends
|
|
7452
|
+
var ta = class extends Ct {
|
|
7434
7453
|
constructor(e) {
|
|
7435
7454
|
super(), this.setProperties(e);
|
|
7436
7455
|
}
|
|
@@ -7444,7 +7463,7 @@ var ta = class extends wt {
|
|
|
7444
7463
|
for (let e in na) i(ta, e, { fallback: na[e] });
|
|
7445
7464
|
//#endregion
|
|
7446
7465
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7447
|
-
var ra = 100, ia = 40, aa = class extends
|
|
7466
|
+
var ra = 100, ia = 40, aa = class extends w {
|
|
7448
7467
|
_parent;
|
|
7449
7468
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7450
7469
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7504,7 +7523,7 @@ var ra = 100, ia = 40, aa = class extends C {
|
|
|
7504
7523
|
}, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
|
|
7505
7524
|
if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
|
|
7506
7525
|
let i = this._cellNodes.get(t);
|
|
7507
|
-
i || (i =
|
|
7526
|
+
i || (i = V.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
|
|
7508
7527
|
}
|
|
7509
7528
|
for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
|
|
7510
7529
|
this._parent.requestDraw();
|
|
@@ -7516,7 +7535,7 @@ var ra = 100, ia = 40, aa = class extends C {
|
|
|
7516
7535
|
}, e.background = t.background;
|
|
7517
7536
|
for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
|
|
7518
7537
|
t.children?.forEach((t) => {
|
|
7519
|
-
e.appendChild(
|
|
7538
|
+
e.appendChild(V.parse(t, "Element2D"));
|
|
7520
7539
|
});
|
|
7521
7540
|
}
|
|
7522
7541
|
_clearCells() {
|
|
@@ -7527,21 +7546,21 @@ var ra = 100, ia = 40, aa = class extends C {
|
|
|
7527
7546
|
this._clearCells();
|
|
7528
7547
|
}
|
|
7529
7548
|
};
|
|
7530
|
-
|
|
7549
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], aa.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], aa.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], aa.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], aa.prototype, "cells", void 0);
|
|
7531
7550
|
//#endregion
|
|
7532
7551
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7533
7552
|
var oa = 2, sa = 16 * 1024 * 1024, ca = 64, la = 0;
|
|
7534
7553
|
function ua() {
|
|
7535
7554
|
if (la) return la;
|
|
7536
7555
|
try {
|
|
7537
|
-
let e =
|
|
7556
|
+
let e = C(), t = e.getContext("webgl2") || e.getContext("webgl");
|
|
7538
7557
|
la = t && t.getParameter(t.MAX_TEXTURE_SIZE) || 4096;
|
|
7539
7558
|
} catch {
|
|
7540
7559
|
la = 4096;
|
|
7541
7560
|
}
|
|
7542
7561
|
return la;
|
|
7543
7562
|
}
|
|
7544
|
-
var X = class extends
|
|
7563
|
+
var X = class extends w {
|
|
7545
7564
|
_parent;
|
|
7546
7565
|
base;
|
|
7547
7566
|
get textContent() {
|
|
@@ -7554,13 +7573,13 @@ var X = class extends C {
|
|
|
7554
7573
|
_autoDrawMode;
|
|
7555
7574
|
_atlasEligible = !1;
|
|
7556
7575
|
_textureStale = !0;
|
|
7557
|
-
_texture = new
|
|
7576
|
+
_texture = new _r({ mipmap: !0 });
|
|
7558
7577
|
_tiles = [];
|
|
7559
7578
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7560
7579
|
_ownedTextureMap = /* @__PURE__ */ new Map();
|
|
7561
7580
|
_textureMapVersion = 0;
|
|
7562
7581
|
constructor(e) {
|
|
7563
|
-
super(), this._parent = e, this.base =
|
|
7582
|
+
super(), this._parent = e, this.base = Nt(new ve()), this.base.setPropertyAccessor(this);
|
|
7564
7583
|
}
|
|
7565
7584
|
setProperties(e) {
|
|
7566
7585
|
return super.setProperties(d(e) ? void 0 : ae(e));
|
|
@@ -7665,7 +7684,7 @@ var X = class extends C {
|
|
|
7665
7684
|
for (let o = 0; o < a; o++) for (let a = 0; a < i; a++) {
|
|
7666
7685
|
let i = a * r, c = o * r, l = Math.min(r, e - i), u = Math.min(r, t - c), d = this._tiles[s];
|
|
7667
7686
|
d || (d = {
|
|
7668
|
-
texture: new
|
|
7687
|
+
texture: new _r({ mipmap: !0 }),
|
|
7669
7688
|
x: i,
|
|
7670
7689
|
y: c,
|
|
7671
7690
|
w: l,
|
|
@@ -7718,17 +7737,17 @@ var X = class extends C {
|
|
|
7718
7737
|
if (t && Object.keys(t).length > 0) {
|
|
7719
7738
|
let i = await this._loadTexture(g(t), n);
|
|
7720
7739
|
if (r !== this._textureMapVersion || this.destroyed) {
|
|
7721
|
-
i instanceof
|
|
7740
|
+
i instanceof wr && i.destroy();
|
|
7722
7741
|
return;
|
|
7723
7742
|
}
|
|
7724
7743
|
this._textureMap.set(e, {
|
|
7725
7744
|
texture: i,
|
|
7726
7745
|
box: n
|
|
7727
|
-
}), i instanceof
|
|
7746
|
+
}), i instanceof wr && this._ownedTextureMap.set(e, i), this._parent.requestDraw();
|
|
7728
7747
|
}
|
|
7729
7748
|
}
|
|
7730
7749
|
async _loadTexture(e, t) {
|
|
7731
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7750
|
+
return e.linearGradient || e.radialGradient ? new wr(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
|
|
7732
7751
|
}
|
|
7733
7752
|
setContent(e) {
|
|
7734
7753
|
this.content = oe(e);
|
|
@@ -7752,12 +7771,12 @@ var X = class extends C {
|
|
|
7752
7771
|
this.base.pathSets.forEach((n) => {
|
|
7753
7772
|
n.paths.forEach((n) => {
|
|
7754
7773
|
let r = n.getMeta();
|
|
7755
|
-
if (r instanceof
|
|
7774
|
+
if (r instanceof _e) {
|
|
7756
7775
|
let i = r.parent.index, a = r.parent.parent.index;
|
|
7757
7776
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7758
7777
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7759
7778
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? this._resolveThemeColor(r.color), e.fill({
|
|
7760
|
-
...
|
|
7779
|
+
...Bi(r, o?.box ?? {
|
|
7761
7780
|
x: 0,
|
|
7762
7781
|
y: 0,
|
|
7763
7782
|
width: this._parent.size.width,
|
|
@@ -7769,7 +7788,7 @@ var X = class extends C {
|
|
|
7769
7788
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
7770
7789
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7771
7790
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? this._resolveThemeColor(r.color), e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
7772
|
-
...
|
|
7791
|
+
...Bi(r, o?.box ?? {
|
|
7773
7792
|
x: 0,
|
|
7774
7793
|
y: 0,
|
|
7775
7794
|
width: this._parent.size.width,
|
|
@@ -7813,7 +7832,7 @@ var X = class extends C {
|
|
|
7813
7832
|
"listStyle",
|
|
7814
7833
|
"highlight"
|
|
7815
7834
|
]) if (this.base.plugins.get(e)?.pathSet?.paths?.length) return !1;
|
|
7816
|
-
let e = 2048 /
|
|
7835
|
+
let e = 2048 / xr.superSample / 1.5, t = this.base.characters;
|
|
7817
7836
|
for (let n = 0; n < t.length; n++) {
|
|
7818
7837
|
let r = t[n].computedStyle;
|
|
7819
7838
|
if (!this._getAtlasCharacterColor(t[n]) || r.fontSize > e) return !1;
|
|
@@ -7821,7 +7840,7 @@ var X = class extends C {
|
|
|
7821
7840
|
return !0;
|
|
7822
7841
|
}
|
|
7823
7842
|
_atlasDraw(e) {
|
|
7824
|
-
let t =
|
|
7843
|
+
let t = xr, n = this.base.characters, r = /* @__PURE__ */ new Map();
|
|
7825
7844
|
for (let e = 0; e < n.length; e++) {
|
|
7826
7845
|
let i = n[e], a = i.glyphBox;
|
|
7827
7846
|
if (!a || a.width <= 0 || a.height <= 0) continue;
|
|
@@ -7857,7 +7876,7 @@ var X = class extends C {
|
|
|
7857
7876
|
super._destroy(), this._releaseTextureMap(), this._releaseTiles(), this._texture.destroy();
|
|
7858
7877
|
}
|
|
7859
7878
|
};
|
|
7860
|
-
|
|
7879
|
+
k([_({ fallback: !0 }), O("design:type", Object)], X.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], X.prototype, "style", void 0), k([_(), O("design:type", Object)], X.prototype, "effects", void 0), k([_(), O("design:type", Object)], X.prototype, "fill", void 0), k([_(), O("design:type", Object)], X.prototype, "outline", void 0), k([_(), O("design:type", Object)], X.prototype, "deformation", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], X.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], X.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], X.prototype, "drawMode", void 0);
|
|
7861
7880
|
//#endregion
|
|
7862
7881
|
//#region src/scene/2d/element/Flexbox.ts
|
|
7863
7882
|
var Z = {
|
|
@@ -7926,7 +7945,7 @@ var Z = {
|
|
|
7926
7945
|
let { loadYoga: e } = await import("yoga-layout/load");
|
|
7927
7946
|
this._yoga = await e();
|
|
7928
7947
|
}
|
|
7929
|
-
node = e._yoga ?
|
|
7948
|
+
node = e._yoga ? Nt(e._yoga.Node.create()) : void 0;
|
|
7930
7949
|
constructor(e) {
|
|
7931
7950
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7932
7951
|
}
|
|
@@ -8096,10 +8115,10 @@ var Z = {
|
|
|
8096
8115
|
function Aa(e, t, n) {
|
|
8097
8116
|
return e < t ? t : e > n ? n : e;
|
|
8098
8117
|
}
|
|
8099
|
-
var ja = class extends
|
|
8118
|
+
var ja = class extends Kr {
|
|
8100
8119
|
flexbox = new xa(this);
|
|
8101
|
-
aabb = new
|
|
8102
|
-
globalAabb = new
|
|
8120
|
+
aabb = new Tt();
|
|
8121
|
+
globalAabb = new Tt();
|
|
8103
8122
|
_parentGlobalDisplay;
|
|
8104
8123
|
_globalDisplay;
|
|
8105
8124
|
get globalDisplay() {
|
|
@@ -8132,7 +8151,7 @@ var ja = class extends Jr {
|
|
|
8132
8151
|
this._endBatch();
|
|
8133
8152
|
}
|
|
8134
8153
|
}
|
|
8135
|
-
_background = new
|
|
8154
|
+
_background = new Vi(this);
|
|
8136
8155
|
get background() {
|
|
8137
8156
|
return this._background;
|
|
8138
8157
|
}
|
|
@@ -8146,21 +8165,21 @@ var ja = class extends Jr {
|
|
|
8146
8165
|
set shape(e) {
|
|
8147
8166
|
this._shape.resetProperties().setProperties(e);
|
|
8148
8167
|
}
|
|
8149
|
-
_fill = new
|
|
8168
|
+
_fill = new Y(this);
|
|
8150
8169
|
get fill() {
|
|
8151
8170
|
return this._fill;
|
|
8152
8171
|
}
|
|
8153
8172
|
set fill(e) {
|
|
8154
8173
|
this._fill.resetProperties().setProperties(e);
|
|
8155
8174
|
}
|
|
8156
|
-
_outline = new
|
|
8175
|
+
_outline = new Qi(this);
|
|
8157
8176
|
get outline() {
|
|
8158
8177
|
return this._outline;
|
|
8159
8178
|
}
|
|
8160
8179
|
set outline(e) {
|
|
8161
8180
|
this._outline.resetProperties().setProperties(e);
|
|
8162
8181
|
}
|
|
8163
|
-
_foreground = new
|
|
8182
|
+
_foreground = new Xi(this);
|
|
8164
8183
|
get foreground() {
|
|
8165
8184
|
return this._foreground;
|
|
8166
8185
|
}
|
|
@@ -8181,7 +8200,7 @@ var ja = class extends Jr {
|
|
|
8181
8200
|
set shadow(e) {
|
|
8182
8201
|
this._shadow.resetProperties().setProperties(e);
|
|
8183
8202
|
}
|
|
8184
|
-
_connection = new
|
|
8203
|
+
_connection = new Ji(this);
|
|
8185
8204
|
get connection() {
|
|
8186
8205
|
return this._connection;
|
|
8187
8206
|
}
|
|
@@ -8195,14 +8214,14 @@ var ja = class extends Jr {
|
|
|
8195
8214
|
set table(e) {
|
|
8196
8215
|
this._table.resetProperties().setProperties(e);
|
|
8197
8216
|
}
|
|
8198
|
-
_chart = new
|
|
8217
|
+
_chart = new Gi(this);
|
|
8199
8218
|
get chart() {
|
|
8200
8219
|
return this._chart;
|
|
8201
8220
|
}
|
|
8202
8221
|
set chart(e) {
|
|
8203
8222
|
this._chart.resetProperties().setProperties(e);
|
|
8204
8223
|
}
|
|
8205
|
-
_comments = new
|
|
8224
|
+
_comments = new Ki(this);
|
|
8206
8225
|
get comments() {
|
|
8207
8226
|
return this._comments;
|
|
8208
8227
|
}
|
|
@@ -8267,7 +8286,7 @@ var ja = class extends Jr {
|
|
|
8267
8286
|
x: Math.max(...o),
|
|
8268
8287
|
y: Math.max(...s)
|
|
8269
8288
|
};
|
|
8270
|
-
this.globalAabb.min.set(c.x, c.y), this.globalAabb.size.set(l.x - c.x, l.y - c.y), this._updateMask(),
|
|
8289
|
+
this.globalAabb.min.set(c.x, c.y), this.globalAabb.size.set(l.x - c.x, l.y - c.y), this._updateMask(), ft();
|
|
8271
8290
|
}
|
|
8272
8291
|
_updateMask() {
|
|
8273
8292
|
this._overflowHidden ? this._mask = this.globalAabb : this._mask = void 0;
|
|
@@ -8298,7 +8317,7 @@ var ja = class extends Jr {
|
|
|
8298
8317
|
this._updateGlobalDisplay();
|
|
8299
8318
|
break;
|
|
8300
8319
|
case "rotate":
|
|
8301
|
-
this.rotation = (t || 0) *
|
|
8320
|
+
this.rotation = (t || 0) * Et, this.updateGlobalTransform();
|
|
8302
8321
|
break;
|
|
8303
8322
|
case "scaleX":
|
|
8304
8323
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -8319,7 +8338,7 @@ var ja = class extends Jr {
|
|
|
8319
8338
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
8320
8339
|
break;
|
|
8321
8340
|
case "transformOrigin": {
|
|
8322
|
-
let e =
|
|
8341
|
+
let e = ri(t ?? "");
|
|
8323
8342
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
8324
8343
|
break;
|
|
8325
8344
|
}
|
|
@@ -8434,13 +8453,13 @@ var ja = class extends Jr {
|
|
|
8434
8453
|
}
|
|
8435
8454
|
_applyColorFilter() {
|
|
8436
8455
|
let e = [this._styleFilter, this._elementFilter].filter(Boolean).join(" ").trim();
|
|
8437
|
-
e ? (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
8456
|
+
e ? (this._colorFilterEffect || (this._colorFilterEffect = new oi({
|
|
8438
8457
|
name: "styleFilter",
|
|
8439
8458
|
internalMode: "front"
|
|
8440
8459
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
|
|
8441
8460
|
}
|
|
8442
8461
|
_updateStyleMaskImage(e) {
|
|
8443
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
8462
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new Mi({
|
|
8444
8463
|
name: "styleMaskImage",
|
|
8445
8464
|
internalMode: "back"
|
|
8446
8465
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -8495,11 +8514,11 @@ var ja = class extends Jr {
|
|
|
8495
8514
|
}
|
|
8496
8515
|
getObb() {
|
|
8497
8516
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
8498
|
-
return new
|
|
8517
|
+
return new kt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
8499
8518
|
}
|
|
8500
8519
|
getGlobalObb() {
|
|
8501
8520
|
let e = this.pivot, t = this.globalScale, n = this.globalTransform.apply(e).sub(e);
|
|
8502
|
-
return new
|
|
8521
|
+
return new kt(this._getPointArray().map((r) => ({
|
|
8503
8522
|
x: e.x + (r.x - e.x) * t.x + n.x,
|
|
8504
8523
|
y: e.y + (r.y - e.y) * t.y + n.y
|
|
8505
8524
|
})), this.globalRotation);
|
|
@@ -8510,7 +8529,7 @@ var ja = class extends Jr {
|
|
|
8510
8529
|
_drawContent() {}
|
|
8511
8530
|
_scrollRangeCache;
|
|
8512
8531
|
getScrollRange() {
|
|
8513
|
-
let e =
|
|
8532
|
+
let e = dt(), t = this._scrollRangeCache;
|
|
8514
8533
|
if (t && t.rev === e) return t.value;
|
|
8515
8534
|
let n = this._computeScrollRange();
|
|
8516
8535
|
return this._scrollRangeCache = {
|
|
@@ -8617,7 +8636,7 @@ var ja = class extends Jr {
|
|
|
8617
8636
|
2,
|
|
8618
8637
|
3
|
|
8619
8638
|
]),
|
|
8620
|
-
texture:
|
|
8639
|
+
texture: vr.get("#000000"),
|
|
8621
8640
|
modulate: [
|
|
8622
8641
|
255,
|
|
8623
8642
|
255,
|
|
@@ -8723,7 +8742,7 @@ var ja = class extends Jr {
|
|
|
8723
8742
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
8724
8743
|
}
|
|
8725
8744
|
};
|
|
8726
|
-
ja =
|
|
8745
|
+
ja = k([x("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ja);
|
|
8727
8746
|
//#endregion
|
|
8728
8747
|
//#region src/scene/2d/TextureRect2D.ts
|
|
8729
8748
|
var Ma = class extends ja {
|
|
@@ -8744,13 +8763,16 @@ var Ma = class extends ja {
|
|
|
8744
8763
|
if (this.texture?.isValid()) {
|
|
8745
8764
|
this.shape.draw(!0), this.context.fillStyle = this.texture;
|
|
8746
8765
|
let { a: e, c: t, tx: n, b: r, d: i, ty: a } = this._uvTransform(), o, s;
|
|
8747
|
-
this.context.fill({
|
|
8748
|
-
|
|
8749
|
-
|
|
8766
|
+
this.context.fill({
|
|
8767
|
+
clampTexture: !0,
|
|
8768
|
+
transformUv: (c, l) => {
|
|
8769
|
+
o = c[l], s = c[l + 1], c[l] = e * o + t * s + n, c[l + 1] = r * o + i * s + a;
|
|
8770
|
+
}
|
|
8771
|
+
});
|
|
8750
8772
|
}
|
|
8751
8773
|
}
|
|
8752
8774
|
}, Na = class extends Ma {
|
|
8753
|
-
texture = new
|
|
8775
|
+
texture = new _r();
|
|
8754
8776
|
animation;
|
|
8755
8777
|
_lastTime = NaN;
|
|
8756
8778
|
constructor(e, t = []) {
|
|
@@ -8780,7 +8802,7 @@ var Ma = class extends ja {
|
|
|
8780
8802
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
8781
8803
|
}
|
|
8782
8804
|
};
|
|
8783
|
-
|
|
8805
|
+
k([_({ fallback: "" }), O("design:type", String)], Na.prototype, "src", void 0), Na = k([x("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Na);
|
|
8784
8806
|
//#endregion
|
|
8785
8807
|
//#region src/scene/2d/Mesh2D.ts
|
|
8786
8808
|
var Pa = class extends ja {
|
|
@@ -8827,17 +8849,17 @@ var Pa = class extends ja {
|
|
|
8827
8849
|
}
|
|
8828
8850
|
}
|
|
8829
8851
|
_drawCircle(e, t) {
|
|
8830
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
8852
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8831
8853
|
}
|
|
8832
8854
|
_drawEllipse(e, t) {
|
|
8833
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
8855
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8834
8856
|
}
|
|
8835
8857
|
_draw() {
|
|
8836
8858
|
let { width: e, height: t } = this.getRect();
|
|
8837
8859
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
8838
8860
|
}
|
|
8839
8861
|
};
|
|
8840
|
-
|
|
8862
|
+
k([_({ fallback: 6 }), O("design:type", Number)], Fa.prototype, "handleSize", void 0);
|
|
8841
8863
|
//#endregion
|
|
8842
8864
|
//#region src/scene/2d/Video2D.ts
|
|
8843
8865
|
var Ia = class extends Ma {
|
|
@@ -8880,16 +8902,16 @@ var Ia = class extends Ma {
|
|
|
8880
8902
|
}
|
|
8881
8903
|
let n = Math.max(0, this.currentTime % t) / 1e3, r = this._timeline, i = r?.playbackRate ?? 1;
|
|
8882
8904
|
if (r?.playing && i > 0) {
|
|
8883
|
-
e.muted = !0, e.loop = this.loop, e.playbackRate =
|
|
8905
|
+
e.muted = !0, e.loop = this.loop, e.playbackRate = E(i, .0625, 16), e.paused && e.isReady && e.play();
|
|
8884
8906
|
let t = Math.abs(e.currentTime - n);
|
|
8885
|
-
!e.seeking && t > Math.max(.3,
|
|
8907
|
+
!e.seeking && t > Math.max(.3, E(i, 1, 16) * .2) && (e.currentTime = n);
|
|
8886
8908
|
} else e.paused || e.pause(), !e.isPlaying && !e.seeking && e.currentTime !== n && (e.currentTime = n, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
|
|
8887
8909
|
}
|
|
8888
8910
|
_process(e) {
|
|
8889
8911
|
super._process(e), this._updateVideoCurrentTime();
|
|
8890
8912
|
}
|
|
8891
8913
|
};
|
|
8892
|
-
|
|
8914
|
+
k([_({ fallback: "" }), O("design:type", String)], Ia.prototype, "src", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], Ia.prototype, "loop", void 0), Ia = k([x("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ia);
|
|
8893
8915
|
//#endregion
|
|
8894
8916
|
//#region src/scene/animation/Animation.ts
|
|
8895
8917
|
function La(e) {
|
|
@@ -8997,7 +9019,7 @@ var Va = {
|
|
|
8997
9019
|
.355,
|
|
8998
9020
|
1
|
|
8999
9021
|
]
|
|
9000
|
-
}, Ha = Object.fromEntries(Object.entries(Va).map(([e, [t, n, r, i]]) => [e, Ba(t, n, r, i)])), Ua = class extends
|
|
9022
|
+
}, Ha = Object.fromEntries(Object.entries(Va).map(([e, [t, n, r, i]]) => [e, Ba(t, n, r, i)])), Ua = class extends H {
|
|
9001
9023
|
_keyframes = [];
|
|
9002
9024
|
_isFirstUpdatePosition = !1;
|
|
9003
9025
|
_cachedProps = new t();
|
|
@@ -9066,7 +9088,7 @@ var Va = {
|
|
|
9066
9088
|
}
|
|
9067
9089
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
9068
9090
|
e.forEach((e, r) => {
|
|
9069
|
-
let i = t === 1 ? n :
|
|
9091
|
+
let i = t === 1 ? n : E(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
9070
9092
|
if (!a) return;
|
|
9071
9093
|
let o = this._parseKeyframes(i, a);
|
|
9072
9094
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
@@ -9137,15 +9159,15 @@ var Va = {
|
|
|
9137
9159
|
startY: t.y
|
|
9138
9160
|
}, this._pathMeasures.set(o, s);
|
|
9139
9161
|
}
|
|
9140
|
-
let c =
|
|
9162
|
+
let c = E(D(La(r.offsetDistance ?? i.offsetDistance), La(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = Ra(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
9141
9163
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
9142
9164
|
}
|
|
9143
9165
|
_getDiffValue(e, t, n, r, i) {
|
|
9144
9166
|
let a, o;
|
|
9145
|
-
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a =
|
|
9146
|
-
else if (n !== void 0) o =
|
|
9167
|
+
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = Ae(e, String(t), i), o = ke(a);
|
|
9168
|
+
else if (n !== void 0) o = Ae(e, String(n), i), a = ke(o);
|
|
9147
9169
|
else return;
|
|
9148
|
-
else a =
|
|
9170
|
+
else a = Ae(e, String(t), i), o = Ae(e, String(n), i);
|
|
9149
9171
|
if (Array.isArray(a) && Array.isArray(o)) {
|
|
9150
9172
|
let e = /* @__PURE__ */ new Set(), t = {}, n = {};
|
|
9151
9173
|
a.forEach(({ name: n, args: r }) => {
|
|
@@ -9158,10 +9180,10 @@ var Va = {
|
|
|
9158
9180
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
9159
9181
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
9160
9182
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
9161
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
9183
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
|
|
9162
9184
|
}).join(", ")}) `;
|
|
9163
9185
|
}), i;
|
|
9164
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
9186
|
+
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
|
|
9165
9187
|
}
|
|
9166
9188
|
isPlaying() {
|
|
9167
9189
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -9184,11 +9206,11 @@ var Va = {
|
|
|
9184
9206
|
});
|
|
9185
9207
|
}
|
|
9186
9208
|
};
|
|
9187
|
-
|
|
9209
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], Ua.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], Ua.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], Ua.prototype, "easing", void 0), Ua = k([x("Animation", {
|
|
9188
9210
|
renderMode: "disabled",
|
|
9189
9211
|
processSortMode: "parent-before",
|
|
9190
9212
|
duration: 2e3
|
|
9191
|
-
}),
|
|
9213
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ua);
|
|
9192
9214
|
//#endregion
|
|
9193
9215
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
9194
9216
|
var Wa = class t extends e {
|
|
@@ -9334,17 +9356,17 @@ var Wa = class t extends e {
|
|
|
9334
9356
|
if (!this._source) return;
|
|
9335
9357
|
let { start: n = 0, end: r = 0 } = e;
|
|
9336
9358
|
r && console.assert(r > n, "End time is before start time"), e.playbackRate !== void 0 && (this._playbackRate = e.playbackRate), e.volume !== void 0 && (this._volume = e.volume), e.loop !== void 0 && (this._loop = e.loop), e.muted !== void 0 && (this._muted = e.muted), this.refresh(), this.loop && r !== null && (console.warn("Looping not support when specifying an \"end\" time"), this.loop = !1), this._start = n, this._end = r || this._duration, this._start = Math.max(0, this._start - t.PADDING), this._end = Math.min(this._end + t.PADDING, this._duration), this._source.onloadedmetadata = () => {
|
|
9337
|
-
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration),
|
|
9359
|
+
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration), S.on(this._onUpdate));
|
|
9338
9360
|
}, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
|
|
9339
9361
|
}
|
|
9340
9362
|
_onUpdate = () => {
|
|
9341
9363
|
this._source && (this.emit("progress", this.progress, this._duration), this._source.currentTime >= this._end && !this._source.loop && this._onComplete());
|
|
9342
9364
|
};
|
|
9343
9365
|
_onComplete() {
|
|
9344
|
-
|
|
9366
|
+
S.off(this._onUpdate), this._stop(), this.emit("progress", 1, this._duration), this.emit("end", this);
|
|
9345
9367
|
}
|
|
9346
9368
|
destroy() {
|
|
9347
|
-
|
|
9369
|
+
S.off(this._onUpdate), super.destroy();
|
|
9348
9370
|
let e = this._source;
|
|
9349
9371
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
9350
9372
|
}
|
|
@@ -9416,15 +9438,15 @@ var Wa = class t extends e {
|
|
|
9416
9438
|
//#endregion
|
|
9417
9439
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
9418
9440
|
function Ya() {
|
|
9419
|
-
if (
|
|
9420
|
-
if (
|
|
9441
|
+
if (Ue) return new AudioContext();
|
|
9442
|
+
if (We) {
|
|
9421
9443
|
let e = globalThis.webkitAudioContext;
|
|
9422
9444
|
return new e();
|
|
9423
9445
|
} else throw Error("Failed to createAudioContext");
|
|
9424
9446
|
}
|
|
9425
9447
|
function Xa(e, t, n) {
|
|
9426
|
-
if (
|
|
9427
|
-
if (
|
|
9448
|
+
if (Ge) return new OfflineAudioContext(e, t, n);
|
|
9449
|
+
if (Ke) {
|
|
9428
9450
|
let r = globalThis.webkitOfflineAudioContext;
|
|
9429
9451
|
return new r(e, t, n);
|
|
9430
9452
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
@@ -9470,8 +9492,8 @@ var Za = class e extends qa {
|
|
|
9470
9492
|
_compressor;
|
|
9471
9493
|
_analyser;
|
|
9472
9494
|
constructor() {
|
|
9473
|
-
let e = Ya(), t = Xa(1, 2,
|
|
9474
|
-
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (
|
|
9495
|
+
let e = Ya(), t = Xa(1, 2, Ge ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
9496
|
+
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Be || Ve), Je && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
9475
9497
|
}
|
|
9476
9498
|
_onFocus() {
|
|
9477
9499
|
if (!this.autoPause) return;
|
|
@@ -9639,7 +9661,7 @@ var Za = class e extends qa {
|
|
|
9639
9661
|
};
|
|
9640
9662
|
_updateListener = () => this._update();
|
|
9641
9663
|
_enableTicker(e) {
|
|
9642
|
-
|
|
9664
|
+
S.off(this._updateListener), e && S.on(this._updateListener);
|
|
9643
9665
|
}
|
|
9644
9666
|
destroy() {
|
|
9645
9667
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
@@ -9693,13 +9715,13 @@ var Za = class e extends qa {
|
|
|
9693
9715
|
createSound() {
|
|
9694
9716
|
return new Qa();
|
|
9695
9717
|
}
|
|
9696
|
-
}, eo, to = class extends
|
|
9718
|
+
}, eo, to = class extends H {
|
|
9697
9719
|
static {
|
|
9698
9720
|
eo = this;
|
|
9699
9721
|
}
|
|
9700
9722
|
static _soundPool = [];
|
|
9701
9723
|
_sounds = [];
|
|
9702
|
-
_platformAudio =
|
|
9724
|
+
_platformAudio = qe ? new $a(this) : new Ka(this);
|
|
9703
9725
|
get platformAudio() {
|
|
9704
9726
|
return this._platformAudio;
|
|
9705
9727
|
}
|
|
@@ -9824,14 +9846,14 @@ var Za = class e extends qa {
|
|
|
9824
9846
|
}, 100);
|
|
9825
9847
|
}
|
|
9826
9848
|
};
|
|
9827
|
-
to = eo =
|
|
9849
|
+
to = eo = k([x("Audio"), O("design:paramtypes", [Object])], to);
|
|
9828
9850
|
//#endregion
|
|
9829
9851
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
9830
|
-
var no = class extends
|
|
9852
|
+
var no = class extends Kr {}, ro = class extends ja {
|
|
9831
9853
|
_audioBuffer;
|
|
9832
9854
|
_src = (() => {
|
|
9833
|
-
let e =
|
|
9834
|
-
return e ? new
|
|
9855
|
+
let e = C();
|
|
9856
|
+
return e ? new z({ source: e }) : void 0;
|
|
9835
9857
|
})();
|
|
9836
9858
|
_needsUpdateTexture = !1;
|
|
9837
9859
|
constructor(e = {}) {
|
|
@@ -9886,16 +9908,16 @@ var no = class extends Jr {}, ro = class extends ja {
|
|
|
9886
9908
|
this.syncTexture(), super._process(e);
|
|
9887
9909
|
}
|
|
9888
9910
|
};
|
|
9889
|
-
|
|
9911
|
+
k([_(), O("design:type", Object)], ro.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], ro.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], ro.prototype, "color", void 0), ro = k([x("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], ro);
|
|
9890
9912
|
//#endregion
|
|
9891
9913
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9892
|
-
var io, ao = class extends
|
|
9914
|
+
var io, ao = class extends Wr {
|
|
9893
9915
|
static {
|
|
9894
9916
|
io = this;
|
|
9895
9917
|
}
|
|
9896
9918
|
blur = 10;
|
|
9897
9919
|
quality = 10;
|
|
9898
|
-
static material = new
|
|
9920
|
+
static material = new I({ gl: {
|
|
9899
9921
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9900
9922
|
fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
|
|
9901
9923
|
} });
|
|
@@ -9910,7 +9932,7 @@ var io, ao = class extends Kr {
|
|
|
9910
9932
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9911
9933
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9912
9934
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9913
|
-
|
|
9935
|
+
L.draw(e, io.material, {
|
|
9914
9936
|
sampler: r,
|
|
9915
9937
|
progress: i,
|
|
9916
9938
|
...t
|
|
@@ -9918,35 +9940,35 @@ var io, ao = class extends Kr {
|
|
|
9918
9940
|
});
|
|
9919
9941
|
}
|
|
9920
9942
|
};
|
|
9921
|
-
ao = io =
|
|
9943
|
+
ao = io = k([x("KawaseTransition")], ao);
|
|
9922
9944
|
//#endregion
|
|
9923
9945
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9924
|
-
var oo, so = class extends
|
|
9946
|
+
var oo, so = class extends Wr {
|
|
9925
9947
|
static {
|
|
9926
9948
|
oo = this;
|
|
9927
9949
|
}
|
|
9928
|
-
static material = new
|
|
9950
|
+
static material = new I({ gl: {
|
|
9929
9951
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9930
9952
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
9931
9953
|
} });
|
|
9932
9954
|
apply(e) {
|
|
9933
|
-
|
|
9955
|
+
L.draw(e, oo.material, {
|
|
9934
9956
|
previous: 0,
|
|
9935
9957
|
next: 1,
|
|
9936
9958
|
progress: this.currentTimeProgress
|
|
9937
9959
|
});
|
|
9938
9960
|
}
|
|
9939
9961
|
};
|
|
9940
|
-
so = oo =
|
|
9962
|
+
so = oo = k([x("LeftEraseTransition")], so);
|
|
9941
9963
|
//#endregion
|
|
9942
9964
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9943
|
-
var co, lo = class extends
|
|
9965
|
+
var co, lo = class extends Wr {
|
|
9944
9966
|
static {
|
|
9945
9967
|
co = this;
|
|
9946
9968
|
}
|
|
9947
9969
|
blur = 100;
|
|
9948
9970
|
gradientBlur = 600;
|
|
9949
|
-
static material = new
|
|
9971
|
+
static material = new I({ gl: {
|
|
9950
9972
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9951
9973
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
|
|
9952
9974
|
} });
|
|
@@ -9954,7 +9976,7 @@ var co, lo = class extends Kr {
|
|
|
9954
9976
|
let n = this.currentTimeProgress, r, i;
|
|
9955
9977
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9956
9978
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
9957
|
-
|
|
9979
|
+
L.draw(e, co.material, {
|
|
9958
9980
|
sampler: r,
|
|
9959
9981
|
progress: i,
|
|
9960
9982
|
blur: this.blur,
|
|
@@ -9963,7 +9985,7 @@ var co, lo = class extends Kr {
|
|
|
9963
9985
|
end: c,
|
|
9964
9986
|
delta: [u / f, d / f],
|
|
9965
9987
|
texSize: l
|
|
9966
|
-
}),
|
|
9988
|
+
}), L.draw(e, co.material, {
|
|
9967
9989
|
sampler: r,
|
|
9968
9990
|
progress: i,
|
|
9969
9991
|
blur: this.blur,
|
|
@@ -9975,10 +9997,10 @@ var co, lo = class extends Kr {
|
|
|
9975
9997
|
});
|
|
9976
9998
|
}
|
|
9977
9999
|
};
|
|
9978
|
-
lo = co =
|
|
10000
|
+
lo = co = k([x("TiltShiftTransition")], lo);
|
|
9979
10001
|
//#endregion
|
|
9980
10002
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9981
|
-
var uo, fo = class extends
|
|
10003
|
+
var uo, fo = class extends Wr {
|
|
9982
10004
|
static {
|
|
9983
10005
|
uo = this;
|
|
9984
10006
|
}
|
|
@@ -9986,7 +10008,7 @@ var uo, fo = class extends Kr {
|
|
|
9986
10008
|
angle = 4;
|
|
9987
10009
|
padding = 20;
|
|
9988
10010
|
offset;
|
|
9989
|
-
static material = new
|
|
10011
|
+
static material = new I({ gl: {
|
|
9990
10012
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9991
10013
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
|
|
9992
10014
|
} });
|
|
@@ -9994,7 +10016,7 @@ var uo, fo = class extends Kr {
|
|
|
9994
10016
|
let n = this.currentTimeProgress, r, i;
|
|
9995
10017
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9996
10018
|
let a = t.width, o = t.height;
|
|
9997
|
-
|
|
10019
|
+
L.draw(e, uo.material, {
|
|
9998
10020
|
sampler: r,
|
|
9999
10021
|
progress: i,
|
|
10000
10022
|
filterArea: [
|
|
@@ -10010,16 +10032,16 @@ var uo, fo = class extends Kr {
|
|
|
10010
10032
|
});
|
|
10011
10033
|
}
|
|
10012
10034
|
};
|
|
10013
|
-
fo = uo =
|
|
10035
|
+
fo = uo = k([x("TwistTransition")], fo);
|
|
10014
10036
|
//#endregion
|
|
10015
10037
|
//#region src/asset/loaders/GifLoader.ts
|
|
10016
|
-
var po = class extends
|
|
10038
|
+
var po = class extends rr {
|
|
10017
10039
|
install(e) {
|
|
10018
10040
|
let t = async (t) => {
|
|
10019
10041
|
let { decodeFrames: n } = await import("modern-gif");
|
|
10020
|
-
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new
|
|
10042
|
+
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new gr(e.map((e) => ({
|
|
10021
10043
|
duration: e.delay,
|
|
10022
|
-
texture: new
|
|
10044
|
+
texture: new Tr({
|
|
10023
10045
|
source: e.data,
|
|
10024
10046
|
width: e.width,
|
|
10025
10047
|
height: e.height
|
|
@@ -10030,14 +10052,14 @@ var po = class extends ir {
|
|
|
10030
10052
|
e.register(n, t);
|
|
10031
10053
|
}), e.gif = this, this;
|
|
10032
10054
|
}
|
|
10033
|
-
}, mo = class extends
|
|
10055
|
+
}, mo = class extends rr {
|
|
10034
10056
|
install(e) {
|
|
10035
10057
|
let t = async (e) => JSON.parse(await e.text());
|
|
10036
10058
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
10037
10059
|
e.register(n, t);
|
|
10038
10060
|
}), e.json = this, this;
|
|
10039
10061
|
}
|
|
10040
|
-
}, ho = class extends
|
|
10062
|
+
}, ho = class extends rr {
|
|
10041
10063
|
install(e) {
|
|
10042
10064
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
10043
10065
|
container: null,
|
|
@@ -10048,14 +10070,14 @@ var po = class extends ir {
|
|
|
10048
10070
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
10049
10071
|
}), e.lottie = this, this;
|
|
10050
10072
|
}
|
|
10051
|
-
}, go = class extends
|
|
10073
|
+
}, go = class extends rr {
|
|
10052
10074
|
install(e) {
|
|
10053
10075
|
let t = async (e) => e.text();
|
|
10054
10076
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
10055
10077
|
}
|
|
10056
|
-
}, _o = class extends
|
|
10078
|
+
}, _o = class extends rr {
|
|
10057
10079
|
install(e) {
|
|
10058
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
10080
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
10059
10081
|
source: e,
|
|
10060
10082
|
uploadMethodId: "image",
|
|
10061
10083
|
mipmap: !0,
|
|
@@ -10077,10 +10099,10 @@ var po = class extends ir {
|
|
|
10077
10099
|
e.register(n, t);
|
|
10078
10100
|
}), e.texture = this, this;
|
|
10079
10101
|
}
|
|
10080
|
-
}, vo = class extends
|
|
10102
|
+
}, vo = class extends rr {
|
|
10081
10103
|
install(e) {
|
|
10082
10104
|
return this.load = (t) => e.awaitBy(async () => {
|
|
10083
|
-
let n = await new
|
|
10105
|
+
let n = await new Dr(t).load();
|
|
10084
10106
|
return e.emit("loaded", t, n), n;
|
|
10085
10107
|
}), e.video = this, this;
|
|
10086
10108
|
}
|
|
@@ -10124,7 +10146,7 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10124
10146
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
10125
10147
|
}) : void 0;
|
|
10126
10148
|
constructor() {
|
|
10127
|
-
super(), So ||
|
|
10149
|
+
super(), So || S.on(this.gc.bind(this), { sort: 2 });
|
|
10128
10150
|
}
|
|
10129
10151
|
use(e) {
|
|
10130
10152
|
return e.install(this), this;
|
|
@@ -10164,7 +10186,7 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10164
10186
|
}).then((e) => {
|
|
10165
10187
|
if (e.complete && e.naturalWidth && e.naturalHeight) return createImageBitmap(e, t);
|
|
10166
10188
|
{
|
|
10167
|
-
let e =
|
|
10189
|
+
let e = C(1, 1);
|
|
10168
10190
|
if (!e) throw Error("createImageBitmap fallback requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
10169
10191
|
return createImageBitmap(e);
|
|
10170
10192
|
}
|
|
@@ -10211,14 +10233,14 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10211
10233
|
n && "destroy" in n && n.destroy();
|
|
10212
10234
|
}), this._handled.clear();
|
|
10213
10235
|
}
|
|
10214
|
-
}, $ = new Co().use(new
|
|
10236
|
+
}, $ = new Co().use(new ir()).use(new po()).use(new mo()).use(new ho()).use(new go()).use(new _o()).use(new vo()), wo = {
|
|
10215
10237
|
alpha: !0,
|
|
10216
10238
|
stencil: !0,
|
|
10217
10239
|
antialias: !1,
|
|
10218
10240
|
premultipliedAlpha: !0,
|
|
10219
10241
|
preserveDrawingBuffer: !1,
|
|
10220
10242
|
powerPreference: "default"
|
|
10221
|
-
}, To = class extends
|
|
10243
|
+
}, To = class extends G {
|
|
10222
10244
|
renderer;
|
|
10223
10245
|
get view() {
|
|
10224
10246
|
return this.renderer.view;
|
|
@@ -10249,9 +10271,9 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10249
10271
|
this._flowEffect = e, this.renderer.batch2D.registerEffect(e ? {
|
|
10250
10272
|
...e,
|
|
10251
10273
|
name: "flowStreak"
|
|
10252
|
-
} :
|
|
10274
|
+
} : Rt);
|
|
10253
10275
|
}
|
|
10254
|
-
_resizeObserver =
|
|
10276
|
+
_resizeObserver = Ie ? new ResizeObserver((e) => {
|
|
10255
10277
|
let t = e[0];
|
|
10256
10278
|
if (t.target === this.view) {
|
|
10257
10279
|
let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
|
|
@@ -10259,8 +10281,8 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10259
10281
|
}
|
|
10260
10282
|
}) : void 0;
|
|
10261
10283
|
constructor(e = {}) {
|
|
10262
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
10263
|
-
super(), this.renderer = new
|
|
10284
|
+
let { view: t, width: n, height: r, pixelRatio: i = Xe, autoResize: a, data: o } = e;
|
|
10285
|
+
super(), this.renderer = new nr(t, {
|
|
10264
10286
|
alpha: e.alpha ?? wo.alpha,
|
|
10265
10287
|
stencil: e.stencil ?? wo.stencil,
|
|
10266
10288
|
antialias: e.antialias ?? wo.antialias,
|
|
@@ -10299,7 +10321,7 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10299
10321
|
return this._exportWidth = 0, this._exportHeight = 0, this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
|
|
10300
10322
|
}
|
|
10301
10323
|
nextTick() {
|
|
10302
|
-
return
|
|
10324
|
+
return xe();
|
|
10303
10325
|
}
|
|
10304
10326
|
async waitUntilLoad() {
|
|
10305
10327
|
await $.waitUntilLoad(), await this.nextTick();
|
|
@@ -10357,7 +10379,7 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10357
10379
|
}
|
|
10358
10380
|
toPixels() {
|
|
10359
10381
|
if (!this.needsChunkReadPixels()) return this.render(), this.renderer.toPixels();
|
|
10360
|
-
let e = this.pixelRatio || 1, t = this.exportWidth, n = this.exportHeight, r = this._exportTileLimit(), i =
|
|
10382
|
+
let e = this.pixelRatio || 1, t = this.exportWidth, n = this.exportHeight, r = this._exportTileLimit(), i = Te(t, n, r), a = Math.floor(t * e), o = Math.floor(n * e), s = a * 4, c = new Uint8ClampedArray(a * o * 4), l = this.root.canvasTransform.clone(), u = Math.min(t, r), d = Math.min(n, r);
|
|
10361
10383
|
this._resizeSilently(u, d);
|
|
10362
10384
|
for (let t of i) {
|
|
10363
10385
|
this.root.canvasTransform.copyFrom(l.clone().translate(-t.x, -t.y)), this.render();
|
|
@@ -10374,9 +10396,9 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10374
10396
|
return new ImageData(this.toPixels(), this.exportWidth, this.exportHeight);
|
|
10375
10397
|
}
|
|
10376
10398
|
toCanvas2D(e = this.toImageData()) {
|
|
10377
|
-
let t =
|
|
10399
|
+
let t = C(e.width, e.height), n = t?.getContext("2d");
|
|
10378
10400
|
t && n && (n.fillStyle = "rgba(0, 0, 0, 0)", n.clearRect(0, 0, t.width, t.height), n.putImageData(e, 0, 0));
|
|
10379
|
-
let r =
|
|
10401
|
+
let r = C(e.width, e.height);
|
|
10380
10402
|
if (!r) throw Error("toCanvas2D requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
10381
10403
|
let i = r.getContext("2d");
|
|
10382
10404
|
return i && t && (i.fillStyle = "rgba(0, 0, 0, 0)", i.clearRect(0, 0, r.width, r.height), i.drawImage(t, 0, 0, t.width, t.height, 0, 0, r.width, r.height)), r;
|
|
@@ -10385,7 +10407,7 @@ var So = "WeakRef" in globalThis, Co = class extends e {
|
|
|
10385
10407
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
10386
10408
|
}
|
|
10387
10409
|
};
|
|
10388
|
-
|
|
10410
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], To.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], To.prototype, "autoStart", void 0);
|
|
10389
10411
|
//#endregion
|
|
10390
10412
|
//#region src/render.ts
|
|
10391
10413
|
var Eo, Do = [], Oo = !1;
|
|
@@ -10453,4 +10475,4 @@ async function No(e) {
|
|
|
10453
10475
|
});
|
|
10454
10476
|
}
|
|
10455
10477
|
//#endregion
|
|
10456
|
-
export {
|
|
10478
|
+
export { Tt as Aabb2D, gr as AnimatedTexture, Ua as Animation, Co as Assets, to as Audio, qa as AudioPipeline, Ja as AudioProcessor, no as AudioSpectrum, ro as AudioWaveform, A as BufferUsage, qr as Camera2D, kr as CanvasContext, zr as CanvasItem, _r as CanvasTexture, T as Color, K as ColorAdjustEffect, oi as ColorFilterEffect, Ot as ColorMatrix, li as ColorOverlayEffect, di as ColorRemoveEffect, mi as ColorReplaceEffect, vr as ColorTexture, w as CoreObject, Et as DEG_TO_RAD, Xe as DEVICE_PIXEL_RATIO, q as DrawboardEffect, xi as DropShadowEffect, W as Effect, fr as EffectMaterial, ja as Element2D, Vi as Element2DBackground, Gi as Element2DChart, Ki as Element2DComments, Ji as Element2DConnection, Y as Element2DFill, Xi as Element2DForeground, Qi as Element2DOutline, $i as Element2DShadow, ea as Element2DShape, ta as Element2DStyle, aa as Element2DTable, X as Element2DText, Ci as EmbossEffect, To as Engine, Pt as FLAG_CLIP_OUTSIDE_UV, Ft as FLAG_STROKE_AA, xa as Flexbox, ir as FontLoader, pr as FxaaMaterial, yi as GaussianBlurEffect, or as Geometry, po as GifLoader, wn as GlBatch2DSystem, vn as GlBlendMode, Bt as GlBuffer, qt as GlBufferSystem, zt as GlBufferTarget, On as GlMaskSystem, on as GlProgram, Mn as GlRenderTarget, Nn as GlRenderTargetSystem, hn as GlShaderSystem, bn as GlState, xn as GlStateSystem, An as GlStencilSystem, j as GlSystem, jn as GlViewportSystem, J as GlitchEffect, br as GlyphAtlas, Di as GodrayEffect, wr as GradientTexture, Ka as HTMLAudio, Wa as HTMLAudioContext, Ga as HTMLSound, Je as IN_BROWSER, Ye as IN_MAC_OS, ar as IndexBuffer, xt as Input, ht as InputEvent, mo as JsonLoader, Ai as KawaseBlurEffect, ao as KawaseTransition, gt as KeyboardInputEvent, so as LeftEraseTransition, rr as Loader, Na as Lottie2D, ho as LottieLoader, jt as MainLoop, Mi as MaskEffect, I as Material, Pa as Mesh2D, jr as Meta, _t as MouseInputEvent, V as Node, Kr as Node2D, kt as Obb2D, Fi as OutlineEffect, Se as PI, Ce as PI_2, Li as PixelateEffect, Tr as PixelsTexture, vt as PointerInputEvent, At as Projection2D, sr as QuadGeometry, L as QuadUvGeometry, Dt as RAD_TO_DEG, St as RefCounted, R as RenderTarget, Vt as Renderer, Ct as Resource, Ue as SUPPORTS_AUDIO_CONTEXT, Ve as SUPPORTS_CLICK_EVENTS, He as SUPPORTS_CREATE_IMAGE_BITMAP, Fe as SUPPORTS_IMAGE_BITMAP, ze as SUPPORTS_MOUSE_EVENTS, Ge as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Le as SUPPORTS_POINTER_EVENTS, Ie as SUPPORTS_RESIZE_OBSERVER, Be as SUPPORTS_TOUCH_EVENTS, Pe as SUPPORTS_WEBGL2, We as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ke as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, qe as SUPPORTS_WEB_AUDIO, Re as SUPPORTS_WHEEL_EVENTS, G as SceneTree, go as TextLoader, z as Texture2D, _o as TextureLoader, Ma as TextureRect2D, S as Ticker, lo as TiltShiftTransition, Hr as Timeline, H as TimelineNode, Fa as TransformRect2D, Wr as Transition, fo as TwistTransition, Ut as UniformGroup, hr as UvGeometry, mr as UvMaterial, F as VertexAttribute, P as VertexBuffer, Ia as Video2D, vo as VideoLoader, Dr as VideoTexture, U as Viewport, Or as ViewportTexture, $a as WebAudio, Za as WebAudioContext, nr as WebGLRenderer, Qa as WebSound, yt as WheelInputEvent, Ur as Window, zi as ZoomBlurEffect, fa as alignMap, $ as assets, Jr as axisDir, ba as boxSizingMap, ft as bumpGeometryRevision, E as clamp, ki as clampFrag, C as createHTMLCanvas, Kt as createIdFromString, be as createNode, lt as crossOrigin, Va as cssEasingPresets, Ba as cubicBezier, x as customNode, ye as customNodes, wo as defaultOptions, ct as determineCrossOrigin, ma as directionMap, pa as displayMap, Z as edgeMap, It as encodeFlowSpeed, ha as flexDirectionMap, ga as flexWrapMap, Rt as flowStreakEffect, Oi as frag, dt as geometryRevision, it as getCanvasFactory, ke as getDefaultCssPropertyValue, st as getGlContextProvider, ko as getRenderEngine, da as gutterMap, mt as instanceId, et as isCanvasElement, Ze as isElementNode, $e as isImageElement, we as isPow2, Qe as isVideoElement, tt as isWebgl2, _a as justifyMap, D as lerp, En as log2, yn as mapGlBlendModes, Nt as markRaw, Tn as nextPow2, xe as nextTick, va as overflowMap, ni as parseCssFilter, je as parseCssFunctions, Ae as parseCssProperty, ri as parseCssTransformOrigin, Te as planExportTiles, ya as positionTypeMap, Mo as render, No as renderPixels, Lr as resetBatchPool, Yr as routeConnection, rt as setCanvasFactory, ot as setGlContextProvider, xr as sharedGlyphAtlas, kn as stencilModeMap, Lt as strokeFeatherEffect };
|