@meta2d/core 1.0.46 → 1.0.47

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/src/core.d.ts CHANGED
@@ -239,6 +239,7 @@ export declare class Meta2d {
239
239
  showInput(pen: Pen, rect?: Rect): void;
240
240
  hideInput(): void;
241
241
  clearDropdownList(): void;
242
+ clearRuleLines(): void;
242
243
  private onEvent;
243
244
  private doEvent;
244
245
  initGlobalTriggers(): void;
@@ -248,6 +249,7 @@ export declare class Meta2d {
248
249
  renderPenRaw: typeof renderPenRaw;
249
250
  toPng(padding?: Padding, callback?: BlobCallback, containBkImg?: boolean, maxWidth?: number): string;
250
251
  activeToPng(padding?: Padding): string;
252
+ pensToPng(pens?: Pen[], padding?: Padding): string;
251
253
  /**
252
254
  * 下载 png
253
255
  * @param name 传入参数自带文件后缀名 例如:'test.png'
package/src/core.js CHANGED
@@ -2655,6 +2655,9 @@ var Meta2d = /** @class */ (function () {
2655
2655
  Meta2d.prototype.clearDropdownList = function () {
2656
2656
  this.canvas.clearDropdownList();
2657
2657
  };
2658
+ Meta2d.prototype.clearRuleLines = function () {
2659
+ this.canvas.clearRuleLines();
2660
+ };
2658
2661
  Meta2d.prototype.initGlobalTriggers = function () {
2659
2662
  var _this = this;
2660
2663
  var _a;
@@ -2813,6 +2816,10 @@ var Meta2d = /** @class */ (function () {
2813
2816
  Meta2d.prototype.activeToPng = function (padding) {
2814
2817
  return this.canvas.activeToPng(padding);
2815
2818
  };
2819
+ Meta2d.prototype.pensToPng = function (pens, padding) {
2820
+ if (pens === void 0) { pens = this.store.active; }
2821
+ return this.canvas.pensToPng(pens, padding);
2822
+ };
2816
2823
  /**
2817
2824
  * 下载 png
2818
2825
  * @param name 传入参数自带文件后缀名 例如:'test.png'
@@ -3324,6 +3331,8 @@ var Meta2d = /** @class */ (function () {
3324
3331
  }
3325
3332
  finally { if (e_8) throw e_8.error; }
3326
3333
  }
3334
+ this.initImageCanvas(pens);
3335
+ this.initTemplateCanvas(pens);
3327
3336
  this.render();
3328
3337
  this.pushHistory({
3329
3338
  type: EditType.Update,
@@ -3357,6 +3366,9 @@ var Meta2d = /** @class */ (function () {
3357
3366
  }
3358
3367
  finally { if (e_9) throw e_9.error; }
3359
3368
  }
3369
+ this.initImageCanvas(pens);
3370
+ this.initTemplateCanvas(pens);
3371
+ this.render();
3360
3372
  this.pushHistory({
3361
3373
  type: EditType.Update,
3362
3374
  initPens: initPens,
@@ -3377,6 +3389,8 @@ var Meta2d = /** @class */ (function () {
3377
3389
  var pen = pens[i];
3378
3390
  this.alignPen(align, pen, rect);
3379
3391
  }
3392
+ this.initImageCanvas(pens);
3393
+ this.initTemplateCanvas(pens);
3380
3394
  this.render();
3381
3395
  this.pushHistory({
3382
3396
  type: EditType.Update,
@@ -3398,6 +3412,8 @@ var Meta2d = /** @class */ (function () {
3398
3412
  var pen = pens[i];
3399
3413
  this.alignPen(align, pen, rect);
3400
3414
  }
3415
+ this.initImageCanvas(pens);
3416
+ this.initTemplateCanvas(pens);
3401
3417
  this.render();
3402
3418
  this.pushHistory({
3403
3419
  type: EditType.Update,
@@ -3484,6 +3500,8 @@ var Meta2d = /** @class */ (function () {
3484
3500
  }
3485
3501
  finally { if (e_10) throw e_10.error; }
3486
3502
  }
3503
+ this.initImageCanvas(pens);
3504
+ this.initTemplateCanvas(pens);
3487
3505
  this.render();
3488
3506
  this.pushHistory({
3489
3507
  type: EditType.Update,
@@ -3534,6 +3552,8 @@ var Meta2d = /** @class */ (function () {
3534
3552
  currentY += maxHeight + space;
3535
3553
  }
3536
3554
  });
3555
+ this.initImageCanvas(pens);
3556
+ this.initTemplateCanvas(pens);
3537
3557
  this.render();
3538
3558
  this.pushHistory({
3539
3559
  type: EditType.Update,
@@ -4450,6 +4470,8 @@ var Meta2d = /** @class */ (function () {
4450
4470
  finally { if (e_18) throw e_18.error; }
4451
4471
  }
4452
4472
  }
4473
+ var allPens = getAllChildren(pen, this.store);
4474
+ this.initImageCanvas(allPens);
4453
4475
  render && this.render();
4454
4476
  };
4455
4477
  Meta2d.prototype.clearHover = function () {