@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.
@@ -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 (pen.lineAnimateType) {
1797
+ switch (type) {
1788
1798
  case LineAnimateType.Beads:
1789
1799
  if (pen.animateReverse) {
1790
1800
  ctx.lineDashOffset = pen.calculative.animatePos;