modern-canvas 0.24.9 → 0.24.10
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 +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9712,7 +9712,7 @@ async function no(e = 100) {
|
|
|
9712
9712
|
}
|
|
9713
9713
|
}
|
|
9714
9714
|
async function ro(e) {
|
|
9715
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = to();
|
|
9715
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.max(1, Math.floor(r)), d = Math.max(1, Math.floor(i)), f = to();
|
|
9716
9716
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resizeForExport(u, d), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitUntilProcessed(), o.length) {
|
|
9717
9717
|
let e = o.length, t = o[e - 1];
|
|
9718
9718
|
for (let n = 0; n < e; n++) {
|
|
@@ -9731,13 +9731,25 @@ async function ro(e) {
|
|
|
9731
9731
|
};
|
|
9732
9732
|
}
|
|
9733
9733
|
async function io(e) {
|
|
9734
|
-
return new Promise((t) => {
|
|
9735
|
-
$a.push(async () =>
|
|
9734
|
+
return new Promise((t, n) => {
|
|
9735
|
+
$a.push(async () => {
|
|
9736
|
+
try {
|
|
9737
|
+
t(await ro(e).then((e) => e.toCanvas2D()));
|
|
9738
|
+
} catch (e) {
|
|
9739
|
+
n(e);
|
|
9740
|
+
}
|
|
9741
|
+
}), no();
|
|
9736
9742
|
});
|
|
9737
9743
|
}
|
|
9738
9744
|
async function ao(e) {
|
|
9739
|
-
return new Promise((t) => {
|
|
9740
|
-
$a.push(async () =>
|
|
9745
|
+
return new Promise((t, n) => {
|
|
9746
|
+
$a.push(async () => {
|
|
9747
|
+
try {
|
|
9748
|
+
t(await ro(e).then((e) => e.pixels));
|
|
9749
|
+
} catch (e) {
|
|
9750
|
+
n(e);
|
|
9751
|
+
}
|
|
9752
|
+
}), no();
|
|
9741
9753
|
});
|
|
9742
9754
|
}
|
|
9743
9755
|
//#endregion
|