modern-canvas 0.27.13 → 0.27.15
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 +13 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2199,7 +2199,10 @@ void main(void) {
|
|
|
2199
2199
|
this._vertexCount + r > this._batchSize && this.flush(), this._vertexCount += r, this._indexCount += n.length, this._batchables.push(e);
|
|
2200
2200
|
}
|
|
2201
2201
|
flush() {
|
|
2202
|
-
if (super.flush(), this._vertexCount === 0)
|
|
2202
|
+
if (super.flush(), this._vertexCount === 0) {
|
|
2203
|
+
this._batchables = [], this._indexCount = 0;
|
|
2204
|
+
return;
|
|
2205
|
+
}
|
|
2203
2206
|
let e = this._vertexCount, t = this._indexCount, n = this._batchables;
|
|
2204
2207
|
this._batchables = [], this._vertexCount = 0, this._indexCount = 0;
|
|
2205
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;
|
|
@@ -4221,7 +4224,9 @@ var Er = class extends z {}, Dr = class extends ue {
|
|
|
4221
4224
|
this._triCache[n] = void 0, e.push({
|
|
4222
4225
|
...a,
|
|
4223
4226
|
vertices: r,
|
|
4224
|
-
indices: i
|
|
4227
|
+
indices: i,
|
|
4228
|
+
effectFlags: 0,
|
|
4229
|
+
effectParam: 0
|
|
4225
4230
|
});
|
|
4226
4231
|
continue;
|
|
4227
4232
|
}
|
|
@@ -10352,22 +10357,22 @@ async function Do(e = 100) {
|
|
|
10352
10357
|
}
|
|
10353
10358
|
}
|
|
10354
10359
|
async function Oo(e) {
|
|
10355
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d =
|
|
10356
|
-
if (
|
|
10360
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d = (e) => Number.isFinite(e) ? Math.floor(e) : 0, f = Math.max(1, d(r)), p = Math.max(1, d(i)), m = Eo();
|
|
10361
|
+
if (m.resetProperties(), m.setProperties(u), m.debug = t, m.fonts = n, m.timeline.currentTime = 0, m.resizeForExport(f, p), m.imagePipelineResolver = s, m.root.removeChildren(!0), m.root.append(a), await c?.(m), await m.waitUntilProcessed(), o.length) {
|
|
10357
10362
|
let e = o.length, t = o[e - 1];
|
|
10358
10363
|
for (let n = 0; n < e; n++) {
|
|
10359
10364
|
let e = o[n], r = (o[n + 1] || e) - e;
|
|
10360
|
-
|
|
10365
|
+
m.timeline.currentTime = e, await m.waitUntilProcessed(), await l?.(m.toPixels(), {
|
|
10361
10366
|
currentTime: e,
|
|
10362
10367
|
duration: r,
|
|
10363
10368
|
progress: t === 0 ? 1 : e / t
|
|
10364
10369
|
});
|
|
10365
10370
|
}
|
|
10366
10371
|
}
|
|
10367
|
-
let
|
|
10372
|
+
let h = m.toPixels();
|
|
10368
10373
|
return {
|
|
10369
|
-
pixels:
|
|
10370
|
-
toCanvas2D: () =>
|
|
10374
|
+
pixels: h,
|
|
10375
|
+
toCanvas2D: () => m.toCanvas2D(new ImageData(h, f, p))
|
|
10371
10376
|
};
|
|
10372
10377
|
}
|
|
10373
10378
|
async function ko(e) {
|