@meta2d/core 1.0.98 → 1.0.99
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/package.json +1 -1
- package/src/canvas/canvas.js +1 -3
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +1 -1
- package/src/core.js.map +1 -1
- package/src/pen/model.d.ts +1 -1
- package/src/pen/render.js +11 -1
- package/src/pen/render.js.map +1 -1
package/src/pen/model.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ export interface Pen extends Rect {
|
|
|
222
222
|
lineAnimateDash?: number[] | string;
|
|
223
223
|
lineAnimateDashOffset?: number;
|
|
224
224
|
lineAnimateElementCount?: number;
|
|
225
|
-
lineAnimateType?: LineAnimateType;
|
|
225
|
+
lineAnimateType?: LineAnimateType | LineAnimateType[];
|
|
226
226
|
lineAnimateTargetType?: lineAnimateTargetType;
|
|
227
227
|
lineAnimateElementWidth?: number;
|
|
228
228
|
lineAnimateElementHeight?: number;
|
package/src/pen/render.js
CHANGED
|
@@ -1783,8 +1783,18 @@ export function setCtxLineAnimate(ctx, pen, store) {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
pen.calculative.animateLineWidth &&
|
|
1785
1785
|
(ctx.lineWidth = pen.calculative.animateLineWidth * store.data.scale);
|
|
1786
|
+
if (Array.isArray(pen.lineAnimateType)) {
|
|
1787
|
+
pen.lineAnimateType.forEach(type => {
|
|
1788
|
+
renderLineAnimate(pen, store, type, ctx);
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
else {
|
|
1792
|
+
renderLineAnimate(pen, store, pen.lineAnimateType, ctx);
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
function renderLineAnimate(pen, store, type, ctx) {
|
|
1786
1796
|
let len = 0;
|
|
1787
|
-
switch (
|
|
1797
|
+
switch (type) {
|
|
1788
1798
|
case LineAnimateType.Beads:
|
|
1789
1799
|
if (pen.animateReverse) {
|
|
1790
1800
|
ctx.lineDashOffset = pen.calculative.animatePos;
|