@idraw/core 0.4.0-beta.3 → 0.4.0-beta.5

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.
@@ -358,7 +358,7 @@ var __privateMethod = (obj, member, method) => {
358
358
  fontWeight: fontWeight$1,
359
359
  strokeWidth
360
360
  };
361
- var __classPrivateFieldSet$2 = function(receiver, state, value, kind, f) {
361
+ var __classPrivateFieldSet$3 = function(receiver, state, value, kind, f) {
362
362
  if (kind === "m")
363
363
  throw new TypeError("Private method is not writable");
364
364
  if (kind === "a" && !f)
@@ -367,7 +367,7 @@ var __privateMethod = (obj, member, method) => {
367
367
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
368
368
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
369
369
  };
370
- var __classPrivateFieldGet$2 = function(receiver, state, kind, f) {
370
+ var __classPrivateFieldGet$3 = function(receiver, state, kind, f) {
371
371
  if (kind === "a" && !f)
372
372
  throw new TypeError("Private accessor was defined without a getter");
373
373
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
@@ -379,17 +379,17 @@ var __privateMethod = (obj, member, method) => {
379
379
  constructor(ctx, opts) {
380
380
  _Context2D_ctx.set(this, void 0);
381
381
  _Context2D_opts.set(this, void 0);
382
- __classPrivateFieldSet$2(this, _Context2D_ctx, ctx, "f");
383
- __classPrivateFieldSet$2(this, _Context2D_opts, Object.assign({ devicePixelRatio: 1, offscreenCanvas: null }, opts), "f");
382
+ __classPrivateFieldSet$3(this, _Context2D_ctx, ctx, "f");
383
+ __classPrivateFieldSet$3(this, _Context2D_opts, Object.assign({ devicePixelRatio: 1, offscreenCanvas: null }, opts), "f");
384
384
  }
385
385
  $undoPixelRatio(num) {
386
- return num / __classPrivateFieldGet$2(this, _Context2D_opts, "f").devicePixelRatio;
386
+ return num / __classPrivateFieldGet$3(this, _Context2D_opts, "f").devicePixelRatio;
387
387
  }
388
388
  $doPixelRatio(num) {
389
- return __classPrivateFieldGet$2(this, _Context2D_opts, "f").devicePixelRatio * num;
389
+ return __classPrivateFieldGet$3(this, _Context2D_opts, "f").devicePixelRatio * num;
390
390
  }
391
391
  $getContext() {
392
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f");
392
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f");
393
393
  }
394
394
  $setFont(opts) {
395
395
  const strList = [];
@@ -398,17 +398,17 @@ var __privateMethod = (obj, member, method) => {
398
398
  }
399
399
  strList.push(`${this.$doPixelRatio(opts.fontSize || 12)}px`);
400
400
  strList.push(`${opts.fontFamily || "sans-serif"}`);
401
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").font = `${strList.join(" ")}`;
401
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").font = `${strList.join(" ")}`;
402
402
  }
403
403
  $getOffscreenCanvas() {
404
- return __classPrivateFieldGet$2(this, _Context2D_opts, "f").offscreenCanvas;
404
+ return __classPrivateFieldGet$3(this, _Context2D_opts, "f").offscreenCanvas;
405
405
  }
406
406
  $resize(opts) {
407
407
  const { width, height, devicePixelRatio, resetStyle } = opts;
408
- const { canvas } = __classPrivateFieldGet$2(this, _Context2D_ctx, "f");
408
+ const { canvas } = __classPrivateFieldGet$3(this, _Context2D_ctx, "f");
409
409
  canvas.width = width * devicePixelRatio;
410
410
  canvas.height = height * devicePixelRatio;
411
- __classPrivateFieldSet$2(this, _Context2D_opts, Object.assign(Object.assign({}, __classPrivateFieldGet$2(this, _Context2D_opts, "f")), {
411
+ __classPrivateFieldSet$3(this, _Context2D_opts, Object.assign(Object.assign({}, __classPrivateFieldGet$3(this, _Context2D_opts, "f")), {
412
412
  devicePixelRatio
413
413
  }), "f");
414
414
  if (resetStyle === true) {
@@ -417,8 +417,8 @@ var __privateMethod = (obj, member, method) => {
417
417
  }
418
418
  }
419
419
  $getSize() {
420
- const { devicePixelRatio } = __classPrivateFieldGet$2(this, _Context2D_opts, "f");
421
- const { width, height } = __classPrivateFieldGet$2(this, _Context2D_ctx, "f").canvas;
420
+ const { devicePixelRatio } = __classPrivateFieldGet$3(this, _Context2D_opts, "f");
421
+ const { width, height } = __classPrivateFieldGet$3(this, _Context2D_ctx, "f").canvas;
422
422
  return {
423
423
  width: width / devicePixelRatio,
424
424
  height: height / devicePixelRatio,
@@ -426,125 +426,125 @@ var __privateMethod = (obj, member, method) => {
426
426
  };
427
427
  }
428
428
  get canvas() {
429
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").canvas;
429
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").canvas;
430
430
  }
431
431
  get fillStyle() {
432
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fillStyle;
432
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fillStyle;
433
433
  }
434
434
  set fillStyle(value) {
435
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fillStyle = value;
435
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fillStyle = value;
436
436
  }
437
437
  get strokeStyle() {
438
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").strokeStyle;
438
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").strokeStyle;
439
439
  }
440
440
  set strokeStyle(color2) {
441
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").strokeStyle = color2;
441
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").strokeStyle = color2;
442
442
  }
443
443
  get lineWidth() {
444
- return this.$undoPixelRatio(__classPrivateFieldGet$2(this, _Context2D_ctx, "f").lineWidth);
444
+ return this.$undoPixelRatio(__classPrivateFieldGet$3(this, _Context2D_ctx, "f").lineWidth);
445
445
  }
446
446
  set lineWidth(w2) {
447
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").lineWidth = this.$doPixelRatio(w2);
447
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").lineWidth = this.$doPixelRatio(w2);
448
448
  }
449
449
  get textAlign() {
450
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").textAlign;
450
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").textAlign;
451
451
  }
452
452
  set textAlign(align) {
453
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").textAlign = align;
453
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").textAlign = align;
454
454
  }
455
455
  get textBaseline() {
456
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").textBaseline;
456
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").textBaseline;
457
457
  }
458
458
  set textBaseline(baseline) {
459
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").textBaseline = baseline;
459
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").textBaseline = baseline;
460
460
  }
461
461
  get globalAlpha() {
462
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").globalAlpha;
462
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").globalAlpha;
463
463
  }
464
464
  set globalAlpha(alpha) {
465
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").globalAlpha = alpha;
465
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").globalAlpha = alpha;
466
466
  }
467
467
  get shadowColor() {
468
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowColor;
468
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowColor;
469
469
  }
470
470
  set shadowColor(color2) {
471
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowColor = color2;
471
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowColor = color2;
472
472
  }
473
473
  get shadowOffsetX() {
474
- return this.$undoPixelRatio(__classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowOffsetX);
474
+ return this.$undoPixelRatio(__classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowOffsetX);
475
475
  }
476
476
  set shadowOffsetX(offsetX) {
477
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowOffsetX = this.$doPixelRatio(offsetX);
477
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowOffsetX = this.$doPixelRatio(offsetX);
478
478
  }
479
479
  get shadowOffsetY() {
480
- return this.$undoPixelRatio(__classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowOffsetY);
480
+ return this.$undoPixelRatio(__classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowOffsetY);
481
481
  }
482
482
  set shadowOffsetY(offsetY) {
483
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowOffsetY = this.$doPixelRatio(offsetY);
483
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowOffsetY = this.$doPixelRatio(offsetY);
484
484
  }
485
485
  get shadowBlur() {
486
- return this.$undoPixelRatio(__classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowBlur);
486
+ return this.$undoPixelRatio(__classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowBlur);
487
487
  }
488
488
  set shadowBlur(blur) {
489
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").shadowBlur = this.$doPixelRatio(blur);
489
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").shadowBlur = this.$doPixelRatio(blur);
490
490
  }
491
491
  get lineCap() {
492
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").lineCap;
492
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").lineCap;
493
493
  }
494
494
  set lineCap(lineCap) {
495
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").lineCap = lineCap;
495
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").lineCap = lineCap;
496
496
  }
497
497
  get globalCompositeOperation() {
498
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").globalCompositeOperation;
498
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").globalCompositeOperation;
499
499
  }
500
500
  set globalCompositeOperation(operations) {
501
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").globalCompositeOperation = operations;
501
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").globalCompositeOperation = operations;
502
502
  }
503
503
  fill(...args) {
504
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fill(...args);
504
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fill(...args);
505
505
  }
506
506
  arc(x2, y2, radius, startAngle, endAngle, anticlockwise) {
507
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").arc(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radius), startAngle, endAngle, anticlockwise);
507
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").arc(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radius), startAngle, endAngle, anticlockwise);
508
508
  }
509
509
  rect(x2, y2, w2, h2) {
510
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").rect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
510
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").rect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
511
511
  }
512
512
  fillRect(x2, y2, w2, h2) {
513
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fillRect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
513
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fillRect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
514
514
  }
515
515
  clearRect(x2, y2, w2, h2) {
516
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").clearRect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
516
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").clearRect(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(w2), this.$doPixelRatio(h2));
517
517
  }
518
518
  beginPath() {
519
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").beginPath();
519
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").beginPath();
520
520
  }
521
521
  closePath() {
522
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").closePath();
522
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").closePath();
523
523
  }
524
524
  lineTo(x2, y2) {
525
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").lineTo(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
525
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").lineTo(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
526
526
  }
527
527
  moveTo(x2, y2) {
528
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").moveTo(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
528
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").moveTo(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
529
529
  }
530
530
  arcTo(x1, y1, x2, y2, radius) {
531
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").arcTo(this.$doPixelRatio(x1), this.$doPixelRatio(y1), this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radius));
531
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").arcTo(this.$doPixelRatio(x1), this.$doPixelRatio(y1), this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radius));
532
532
  }
533
533
  getLineDash() {
534
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").getLineDash();
534
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").getLineDash();
535
535
  }
536
536
  setLineDash(nums) {
537
537
  const dash = nums.map((n) => this.$doPixelRatio(n));
538
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").setLineDash(dash);
538
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").setLineDash(dash);
539
539
  }
540
540
  stroke(path) {
541
- return path ? __classPrivateFieldGet$2(this, _Context2D_ctx, "f").stroke(path) : __classPrivateFieldGet$2(this, _Context2D_ctx, "f").stroke();
541
+ return path ? __classPrivateFieldGet$3(this, _Context2D_ctx, "f").stroke(path) : __classPrivateFieldGet$3(this, _Context2D_ctx, "f").stroke();
542
542
  }
543
543
  translate(x2, y2) {
544
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").translate(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
544
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").translate(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
545
545
  }
546
546
  rotate(angle2) {
547
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").rotate(angle2);
547
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").rotate(angle2);
548
548
  }
549
549
  drawImage(...args) {
550
550
  const image = args[0];
@@ -557,64 +557,64 @@ var __privateMethod = (obj, member, method) => {
557
557
  const dw = args[args.length - 2];
558
558
  const dh = args[args.length - 1];
559
559
  if (args.length === 9) {
560
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").drawImage(image, this.$doPixelRatio(sx), this.$doPixelRatio(sy), this.$doPixelRatio(sw), this.$doPixelRatio(sh), this.$doPixelRatio(dx), this.$doPixelRatio(dy), this.$doPixelRatio(dw), this.$doPixelRatio(dh));
560
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").drawImage(image, this.$doPixelRatio(sx), this.$doPixelRatio(sy), this.$doPixelRatio(sw), this.$doPixelRatio(sh), this.$doPixelRatio(dx), this.$doPixelRatio(dy), this.$doPixelRatio(dw), this.$doPixelRatio(dh));
561
561
  } else {
562
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").drawImage(image, this.$doPixelRatio(dx), this.$doPixelRatio(dy), this.$doPixelRatio(dw), this.$doPixelRatio(dh));
562
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").drawImage(image, this.$doPixelRatio(dx), this.$doPixelRatio(dy), this.$doPixelRatio(dw), this.$doPixelRatio(dh));
563
563
  }
564
564
  }
565
565
  createPattern(image, repetition) {
566
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").createPattern(image, repetition);
566
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").createPattern(image, repetition);
567
567
  }
568
568
  measureText(text2) {
569
- const textMetrics = __classPrivateFieldGet$2(this, _Context2D_ctx, "f").measureText(text2);
569
+ const textMetrics = __classPrivateFieldGet$3(this, _Context2D_ctx, "f").measureText(text2);
570
570
  return textMetrics;
571
571
  }
572
572
  fillText(text2, x2, y2, maxWidth) {
573
573
  if (maxWidth !== void 0) {
574
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fillText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(maxWidth));
574
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fillText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(maxWidth));
575
575
  } else {
576
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").fillText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
576
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").fillText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
577
577
  }
578
578
  }
579
579
  strokeText(text2, x2, y2, maxWidth) {
580
580
  if (maxWidth !== void 0) {
581
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").strokeText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(maxWidth));
581
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").strokeText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(maxWidth));
582
582
  } else {
583
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").strokeText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
583
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").strokeText(text2, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
584
584
  }
585
585
  }
586
586
  save() {
587
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").save();
587
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").save();
588
588
  }
589
589
  restore() {
590
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").restore();
590
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").restore();
591
591
  }
592
592
  scale(ratioX, ratioY) {
593
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").scale(ratioX, ratioY);
593
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").scale(ratioX, ratioY);
594
594
  }
595
595
  circle(x2, y2, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {
596
- __classPrivateFieldGet$2(this, _Context2D_ctx, "f").ellipse(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radiusX), this.$doPixelRatio(radiusY), rotation, startAngle, endAngle, counterclockwise);
596
+ __classPrivateFieldGet$3(this, _Context2D_ctx, "f").ellipse(this.$doPixelRatio(x2), this.$doPixelRatio(y2), this.$doPixelRatio(radiusX), this.$doPixelRatio(radiusY), rotation, startAngle, endAngle, counterclockwise);
597
597
  }
598
598
  isPointInPath(x2, y2) {
599
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").isPointInPath(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
599
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").isPointInPath(this.$doPixelRatio(x2), this.$doPixelRatio(y2));
600
600
  }
601
601
  clip(...args) {
602
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").clip(...args);
602
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").clip(...args);
603
603
  }
604
604
  setTransform(a, b, c, d, e, f) {
605
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").setTransform(a, b, c, d, e, f);
605
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").setTransform(a, b, c, d, e, f);
606
606
  }
607
607
  getTransform() {
608
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").getTransform();
608
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").getTransform();
609
609
  }
610
610
  createLinearGradient(x0, y0, x1, y1) {
611
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").createLinearGradient(this.$doPixelRatio(x0), this.$doPixelRatio(y0), this.$doPixelRatio(x1), this.$doPixelRatio(y1));
611
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").createLinearGradient(this.$doPixelRatio(x0), this.$doPixelRatio(y0), this.$doPixelRatio(x1), this.$doPixelRatio(y1));
612
612
  }
613
613
  createRadialGradient(x0, y0, r0, x1, y1, r1) {
614
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").createRadialGradient(this.$doPixelRatio(x0), this.$doPixelRatio(y0), this.$doPixelRatio(r0), this.$doPixelRatio(x1), this.$doPixelRatio(y1), this.$doPixelRatio(r1));
614
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").createRadialGradient(this.$doPixelRatio(x0), this.$doPixelRatio(y0), this.$doPixelRatio(r0), this.$doPixelRatio(x1), this.$doPixelRatio(y1), this.$doPixelRatio(r1));
615
615
  }
616
616
  createConicGradient(startAngle, x2, y2) {
617
- return __classPrivateFieldGet$2(this, _Context2D_ctx, "f").createConicGradient(startAngle, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
617
+ return __classPrivateFieldGet$3(this, _Context2D_ctx, "f").createConicGradient(startAngle, this.$doPixelRatio(x2), this.$doPixelRatio(y2));
618
618
  }
619
619
  }
620
620
  _Context2D_ctx = /* @__PURE__ */ new WeakMap(), _Context2D_opts = /* @__PURE__ */ new WeakMap();
@@ -1528,7 +1528,7 @@ var __privateMethod = (obj, member, method) => {
1528
1528
  const { scale } = viewScaleInfo;
1529
1529
  let { borderRadius: borderRadius2 } = viewElem.detail;
1530
1530
  const { boxSizing = defaultElemConfig$1.boxSizing, borderWidth: borderWidth2 } = viewElem.detail;
1531
- if (typeof borderWidth2 !== "number") {
1531
+ if (Array.isArray(borderWidth2)) {
1532
1532
  borderRadius2 = 0;
1533
1533
  }
1534
1534
  let { x: x2, y: y2, w: w2, h: h2 } = viewElem;
@@ -1572,6 +1572,103 @@ var __privateMethod = (obj, member, method) => {
1572
1572
  radiusList
1573
1573
  };
1574
1574
  }
1575
+ const doNum = (n) => {
1576
+ return formatNumber(n, { decimalPlaces: 4 });
1577
+ };
1578
+ function resizeElementBaseDetail(elem, opts) {
1579
+ const { detail } = elem;
1580
+ const { xRatio, yRatio, maxRatio } = opts;
1581
+ const middleRatio = (xRatio + yRatio) / 2;
1582
+ const { borderWidth: borderWidth2, borderRadius: borderRadius2, borderDash, shadowOffsetX, shadowOffsetY, shadowBlur } = detail;
1583
+ if (typeof borderWidth2 === "number") {
1584
+ detail.borderWidth = doNum(borderWidth2 * middleRatio);
1585
+ } else if (Array.isArray(detail.borderWidth)) {
1586
+ const bw = borderWidth2;
1587
+ detail.borderWidth = [doNum(bw[0] * yRatio), doNum(bw[1] * xRatio), doNum(bw[2] * yRatio), doNum(bw[3] * xRatio)];
1588
+ }
1589
+ if (typeof borderRadius2 === "number") {
1590
+ detail.borderRadius = doNum(borderRadius2 * middleRatio);
1591
+ } else if (Array.isArray(detail.borderRadius)) {
1592
+ const br = borderRadius2;
1593
+ detail.borderRadius = [br[0] * xRatio, br[1] * xRatio, br[2] * yRatio, br[3] * yRatio];
1594
+ }
1595
+ if (Array.isArray(borderDash)) {
1596
+ borderDash.forEach((dash, i) => {
1597
+ detail.borderDash[i] = doNum(dash * maxRatio);
1598
+ });
1599
+ }
1600
+ if (typeof shadowOffsetX === "number") {
1601
+ detail.shadowOffsetX = doNum(shadowOffsetX * maxRatio);
1602
+ }
1603
+ if (typeof shadowOffsetY === "number") {
1604
+ detail.shadowOffsetX = doNum(shadowOffsetY * maxRatio);
1605
+ }
1606
+ if (typeof shadowBlur === "number") {
1607
+ detail.shadowOffsetX = doNum(shadowBlur * maxRatio);
1608
+ }
1609
+ }
1610
+ function resizeElementBase(elem, opts) {
1611
+ const { xRatio, yRatio } = opts;
1612
+ const { x: x2, y: y2, w: w2, h: h2 } = elem;
1613
+ elem.x = doNum(x2 * xRatio);
1614
+ elem.y = doNum(y2 * yRatio);
1615
+ elem.w = doNum(w2 * xRatio);
1616
+ elem.h = doNum(h2 * yRatio);
1617
+ resizeElementBaseDetail(elem, opts);
1618
+ }
1619
+ function resizeTextElementDetail(elem, opts) {
1620
+ const { minRatio, maxRatio } = opts;
1621
+ const { fontSize: fontSize2, lineHeight: lineHeight2 } = elem.detail;
1622
+ const ratio = (minRatio + maxRatio) / 2;
1623
+ if (fontSize2 && fontSize2 > 0) {
1624
+ elem.detail.fontSize = doNum(fontSize2 * ratio);
1625
+ }
1626
+ if (lineHeight2 && lineHeight2 > 0) {
1627
+ elem.detail.lineHeight = doNum(lineHeight2 * ratio);
1628
+ }
1629
+ }
1630
+ function resizeElement$1(elem, opts) {
1631
+ const { type } = elem;
1632
+ resizeElementBase(elem, opts);
1633
+ if (type === "circle")
1634
+ ;
1635
+ else if (type === "text") {
1636
+ resizeTextElementDetail(elem, opts);
1637
+ } else if (type === "image")
1638
+ ;
1639
+ else if (type === "svg")
1640
+ ;
1641
+ else if (type === "html")
1642
+ ;
1643
+ else if (type === "path")
1644
+ ;
1645
+ else if (type === "group" && Array.isArray(elem.detail.children)) {
1646
+ elem.detail.children.forEach((child) => {
1647
+ resizeElement$1(child, opts);
1648
+ });
1649
+ }
1650
+ }
1651
+ function deepResizeGroupElement(elem, size) {
1652
+ const resizeW = size.w && size.w > 0 ? size.w : elem.w;
1653
+ const resizeH = size.h && size.h > 0 ? size.h : elem.h;
1654
+ const xRatio = resizeW / elem.w;
1655
+ const yRatio = resizeH / elem.h;
1656
+ if (xRatio === yRatio && xRatio === 1) {
1657
+ return elem;
1658
+ }
1659
+ const minRatio = Math.min(xRatio, yRatio);
1660
+ const maxRatio = Math.max(xRatio, yRatio);
1661
+ elem.w = resizeW;
1662
+ elem.h = resizeH;
1663
+ const opts = { xRatio, yRatio, minRatio, maxRatio };
1664
+ if (elem.type === "group" && Array.isArray(elem.detail.children)) {
1665
+ elem.detail.children.forEach((child) => {
1666
+ resizeElement$1(child, opts);
1667
+ });
1668
+ }
1669
+ resizeElementBaseDetail(elem, opts);
1670
+ return elem;
1671
+ }
1575
1672
  function createColorStyle(ctx, color2, opts) {
1576
1673
  if (typeof color2 === "string") {
1577
1674
  return color2;
@@ -1616,24 +1713,29 @@ var __privateMethod = (obj, member, method) => {
1616
1713
  return "#000000";
1617
1714
  }
1618
1715
  const defaultElemConfig = getDefaultElementDetailConfig();
1716
+ function getOpacity(elem) {
1717
+ var _a, _b, _c, _d;
1718
+ let opacity = 1;
1719
+ if (((_a = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _a === void 0 ? void 0 : _a.opacity) !== void 0 && ((_b = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _b === void 0 ? void 0 : _b.opacity) >= 0 && ((_c = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _c === void 0 ? void 0 : _c.opacity) <= 1) {
1720
+ opacity = (_d = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _d === void 0 ? void 0 : _d.opacity;
1721
+ }
1722
+ return opacity;
1723
+ }
1619
1724
  function drawBox(ctx, viewElem, opts) {
1620
1725
  const { pattern, renderContent, originElem, calcElemSize, viewScaleInfo, viewSizeInfo } = opts || {};
1726
+ const { parentOpacity } = opts;
1727
+ const opacity = getOpacity(originElem) * parentOpacity;
1621
1728
  drawClipPath(ctx, viewElem, {
1622
1729
  originElem,
1623
1730
  calcElemSize,
1624
1731
  viewScaleInfo,
1625
1732
  viewSizeInfo,
1626
1733
  renderContent: () => {
1627
- var _a, _b;
1628
- if (((_a = viewElem === null || viewElem === void 0 ? void 0 : viewElem.detail) === null || _a === void 0 ? void 0 : _a.opacity) !== void 0 && ((_b = viewElem === null || viewElem === void 0 ? void 0 : viewElem.detail) === null || _b === void 0 ? void 0 : _b.opacity) >= 0) {
1629
- ctx.globalAlpha = viewElem.detail.opacity;
1630
- } else {
1631
- ctx.globalAlpha = 1;
1632
- }
1734
+ ctx.globalAlpha = opacity;
1633
1735
  drawBoxBackground(ctx, viewElem, { pattern, viewScaleInfo, viewSizeInfo });
1634
1736
  renderContent === null || renderContent === void 0 ? void 0 : renderContent();
1635
1737
  drawBoxBorder(ctx, viewElem, { viewScaleInfo, viewSizeInfo });
1636
- ctx.globalAlpha = 1;
1738
+ ctx.globalAlpha = parentOpacity;
1637
1739
  }
1638
1740
  });
1639
1741
  }
@@ -1670,8 +1772,6 @@ var __privateMethod = (obj, member, method) => {
1670
1772
  var _a, _b;
1671
1773
  const { pattern, viewScaleInfo, viewSizeInfo } = opts;
1672
1774
  const transform = [];
1673
- viewElem.detail;
1674
- viewElem.detail;
1675
1775
  if (viewElem.detail.background || pattern) {
1676
1776
  const { x: x2, y: y2, w: w2, h: h2, radiusList } = calcViewBoxSize(viewElem, {
1677
1777
  viewScaleInfo,
@@ -1724,18 +1824,12 @@ var __privateMethod = (obj, member, method) => {
1724
1824
  }
1725
1825
  }
1726
1826
  function drawBoxBorder(ctx, viewElem, opts) {
1727
- var _a, _b;
1728
1827
  if (viewElem.detail.borderWidth === 0) {
1729
1828
  return;
1730
1829
  }
1731
1830
  if (!isColorStr(viewElem.detail.borderColor)) {
1732
1831
  return;
1733
1832
  }
1734
- if (((_a = viewElem === null || viewElem === void 0 ? void 0 : viewElem.detail) === null || _a === void 0 ? void 0 : _a.opacity) !== void 0 && ((_b = viewElem === null || viewElem === void 0 ? void 0 : viewElem.detail) === null || _b === void 0 ? void 0 : _b.opacity) >= 0) {
1735
- ctx.globalAlpha = viewElem.detail.opacity;
1736
- } else {
1737
- ctx.globalAlpha = 1;
1738
- }
1739
1833
  const { viewScaleInfo } = opts;
1740
1834
  const { scale } = viewScaleInfo;
1741
1835
  let borderColor2 = defaultElemConfig.borderColor;
@@ -1859,7 +1953,6 @@ var __privateMethod = (obj, member, method) => {
1859
1953
  ctx.arcTo(x2, y2, x2 + w2, y2, radiusList[0]);
1860
1954
  ctx.closePath();
1861
1955
  ctx.stroke();
1862
- ctx.globalAlpha = 1;
1863
1956
  }
1864
1957
  ctx.setLineDash([]);
1865
1958
  }
@@ -1881,8 +1974,14 @@ var __privateMethod = (obj, member, method) => {
1881
1974
  }
1882
1975
  function drawCircle(ctx, elem, opts) {
1883
1976
  const { detail, angle: angle2 } = elem;
1884
- const { background: background2 = "#000000", borderColor: borderColor2 = "#000000", borderWidth: borderWidth2 = 0 } = detail;
1885
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
1977
+ const { background: background2 = "#000000", borderColor: borderColor2 = "#000000", boxSizing, borderWidth: borderWidth2 = 0 } = detail;
1978
+ let bw = 0;
1979
+ if (typeof borderWidth2 === "number" && borderWidth2 > 0) {
1980
+ bw = borderWidth2;
1981
+ } else if (Array.isArray(borderWidth2) && typeof borderWidth2[0] === "number" && borderWidth2[0] > 0) {
1982
+ bw = borderWidth2[0];
1983
+ }
1984
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
1886
1985
  const { x: x2, y: y2, w: w2, h: h2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize({ x: elem.x, y: elem.y, w: elem.w, h: elem.h }, viewScaleInfo, viewSizeInfo)) || elem;
1887
1986
  const viewElem = Object.assign(Object.assign({}, elem), { x: x2, y: y2, w: w2, h: h2, angle: angle2 });
1888
1987
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
@@ -1890,16 +1989,24 @@ var __privateMethod = (obj, member, method) => {
1890
1989
  viewScaleInfo,
1891
1990
  viewSizeInfo,
1892
1991
  renderContent: () => {
1893
- var _a, _b;
1894
- const a = w2 / 2;
1895
- const b = h2 / 2;
1992
+ let a = w2 / 2;
1993
+ let b = h2 / 2;
1896
1994
  const centerX = x2 + a;
1897
1995
  const centerY = y2 + b;
1898
- if (((_a = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _a === void 0 ? void 0 : _a.opacity) !== void 0 && ((_b = elem === null || elem === void 0 ? void 0 : elem.detail) === null || _b === void 0 ? void 0 : _b.opacity) >= 0) {
1899
- ctx.globalAlpha = elem.detail.opacity;
1900
- } else {
1901
- ctx.globalAlpha = 1;
1996
+ if (bw > 0) {
1997
+ if (boxSizing === "border-box") {
1998
+ a = a - bw;
1999
+ b = b - bw;
2000
+ } else if (boxSizing === "center-line") {
2001
+ a = a - bw / 2;
2002
+ b = b - bw / 2;
2003
+ } else {
2004
+ a = a - bw;
2005
+ b = b - bw;
2006
+ }
1902
2007
  }
2008
+ const opacity = getOpacity(viewElem) * parentOpacity;
2009
+ ctx.globalAlpha = opacity;
1903
2010
  if (typeof borderWidth2 === "number" && borderWidth2 > 0) {
1904
2011
  const ba = borderWidth2 / 2 + a;
1905
2012
  const bb = borderWidth2 / 2 + b;
@@ -1920,13 +2027,13 @@ var __privateMethod = (obj, member, method) => {
1920
2027
  ctx.circle(centerX, centerY, a, b, 0, 0, 2 * Math.PI);
1921
2028
  ctx.closePath();
1922
2029
  ctx.fill();
1923
- ctx.globalAlpha = 1;
2030
+ ctx.globalAlpha = parentOpacity;
1924
2031
  }
1925
2032
  });
1926
2033
  });
1927
2034
  }
1928
2035
  function drawRect(ctx, elem, opts) {
1929
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2036
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
1930
2037
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
1931
2038
  const viewElem = Object.assign(Object.assign({}, elem), { x: x2, y: y2, w: w2, h: h2, angle: angle2 });
1932
2039
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
@@ -1939,6 +2046,7 @@ var __privateMethod = (obj, member, method) => {
1939
2046
  calcElemSize: { x: x2, y: y2, w: w2, h: h2, angle: angle2 },
1940
2047
  viewScaleInfo,
1941
2048
  viewSizeInfo,
2049
+ parentOpacity,
1942
2050
  renderContent: () => {
1943
2051
  }
1944
2052
  });
@@ -1948,7 +2056,7 @@ var __privateMethod = (obj, member, method) => {
1948
2056
  }
1949
2057
  function drawImage(ctx, elem, opts) {
1950
2058
  const content = opts.loader.getContent(elem);
1951
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2059
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
1952
2060
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
1953
2061
  const viewElem = Object.assign(Object.assign({}, elem), { x: x2, y: y2, w: w2, h: h2, angle: angle2 });
1954
2062
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
@@ -1961,13 +2069,13 @@ var __privateMethod = (obj, member, method) => {
1961
2069
  calcElemSize: { x: x2, y: y2, w: w2, h: h2, angle: angle2 },
1962
2070
  viewScaleInfo,
1963
2071
  viewSizeInfo,
2072
+ parentOpacity,
1964
2073
  renderContent: () => {
1965
2074
  if (!content) {
1966
2075
  opts.loader.load(elem, opts.elementAssets || {});
1967
2076
  }
1968
2077
  if (elem.type === "image" && content) {
1969
- const { opacity } = elem.detail;
1970
- ctx.globalAlpha = opacity ? opacity : 1;
2078
+ ctx.globalAlpha = getOpacity(elem) * parentOpacity;
1971
2079
  const { x: x3, y: y3, w: w3, h: h3, radiusList } = calcViewBoxSize(viewElem, {
1972
2080
  viewScaleInfo,
1973
2081
  viewSizeInfo
@@ -1984,7 +2092,7 @@ var __privateMethod = (obj, member, method) => {
1984
2092
  ctx.fill();
1985
2093
  ctx.clip();
1986
2094
  ctx.drawImage(content, x3, y3, w3, h3);
1987
- ctx.globalAlpha = 1;
2095
+ ctx.globalAlpha = parentOpacity;
1988
2096
  ctx.restore();
1989
2097
  }
1990
2098
  }
@@ -1995,39 +2103,37 @@ var __privateMethod = (obj, member, method) => {
1995
2103
  }
1996
2104
  function drawSVG(ctx, elem, opts) {
1997
2105
  const content = opts.loader.getContent(elem);
1998
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2106
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
1999
2107
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
2000
2108
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
2001
2109
  if (!content) {
2002
2110
  opts.loader.load(elem, opts.elementAssets || {});
2003
2111
  }
2004
2112
  if (elem.type === "svg" && content) {
2005
- const { opacity } = elem.detail;
2006
- ctx.globalAlpha = opacity ? opacity : 1;
2113
+ ctx.globalAlpha = getOpacity(elem) * parentOpacity;
2007
2114
  ctx.drawImage(content, x2, y2, w2, h2);
2008
- ctx.globalAlpha = 1;
2115
+ ctx.globalAlpha = parentOpacity;
2009
2116
  }
2010
2117
  });
2011
2118
  }
2012
2119
  function drawHTML(ctx, elem, opts) {
2013
2120
  const content = opts.loader.getContent(elem);
2014
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2121
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
2015
2122
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
2016
2123
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
2017
2124
  if (!content) {
2018
2125
  opts.loader.load(elem, opts.elementAssets || {});
2019
2126
  }
2020
2127
  if (elem.type === "html" && content) {
2021
- const { opacity } = elem.detail;
2022
- ctx.globalAlpha = opacity ? opacity : 1;
2128
+ ctx.globalAlpha = getOpacity(elem) * parentOpacity;
2023
2129
  ctx.drawImage(content, x2, y2, w2, h2);
2024
- ctx.globalAlpha = 1;
2130
+ ctx.globalAlpha = parentOpacity;
2025
2131
  }
2026
2132
  });
2027
2133
  }
2028
2134
  const detailConfig = getDefaultElementDetailConfig();
2029
2135
  function drawText(ctx, elem, opts) {
2030
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2136
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
2031
2137
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
2032
2138
  const viewElem = Object.assign(Object.assign({}, elem), { x: x2, y: y2, w: w2, h: h2, angle: angle2 });
2033
2139
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
@@ -2036,6 +2142,7 @@ var __privateMethod = (obj, member, method) => {
2036
2142
  calcElemSize: { x: x2, y: y2, w: w2, h: h2, angle: angle2 },
2037
2143
  viewScaleInfo,
2038
2144
  viewSizeInfo,
2145
+ parentOpacity,
2039
2146
  renderContent: () => {
2040
2147
  const detail = Object.assign(Object.assign({}, detailConfig), elem.detail);
2041
2148
  const fontSize2 = (detail.fontSize || detailConfig.fontSize) * viewScaleInfo.scale;
@@ -2130,7 +2237,7 @@ var __privateMethod = (obj, member, method) => {
2130
2237
  function drawPath(ctx, elem, opts) {
2131
2238
  const { detail } = elem;
2132
2239
  const { originX, originY, originW, originH } = detail;
2133
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2240
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
2134
2241
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize(elem, viewScaleInfo, viewSizeInfo)) || elem;
2135
2242
  const scaleW = w2 / originW;
2136
2243
  const scaleH = h2 / originH;
@@ -2146,6 +2253,7 @@ var __privateMethod = (obj, member, method) => {
2146
2253
  calcElemSize: { x: x2, y: y2, w: w2, h: h2, angle: angle2 },
2147
2254
  viewScaleInfo,
2148
2255
  viewSizeInfo,
2256
+ parentOpacity,
2149
2257
  renderContent: () => {
2150
2258
  drawBoxShadow(ctx, viewElem, {
2151
2259
  viewScaleInfo,
@@ -2223,10 +2331,11 @@ var __privateMethod = (obj, member, method) => {
2223
2331
  }
2224
2332
  }
2225
2333
  function drawGroup(ctx, elem, opts) {
2226
- const { calculator, viewScaleInfo, viewSizeInfo } = opts;
2334
+ const { calculator, viewScaleInfo, viewSizeInfo, parentOpacity } = opts;
2227
2335
  const { x: x2, y: y2, w: w2, h: h2, angle: angle2 } = (calculator === null || calculator === void 0 ? void 0 : calculator.elementSize({ x: elem.x, y: elem.y, w: elem.w, h: elem.h, angle: elem.angle }, viewScaleInfo, viewSizeInfo)) || elem;
2228
2336
  const viewElem = Object.assign(Object.assign({}, elem), { x: x2, y: y2, w: w2, h: h2, angle: angle2 });
2229
2337
  rotateElement(ctx, { x: x2, y: y2, w: w2, h: h2, angle: angle2 }, () => {
2338
+ ctx.globalAlpha = getOpacity(elem) * parentOpacity;
2230
2339
  drawBoxShadow(ctx, viewElem, {
2231
2340
  viewScaleInfo,
2232
2341
  viewSizeInfo,
@@ -2236,6 +2345,7 @@ var __privateMethod = (obj, member, method) => {
2236
2345
  calcElemSize: { x: x2, y: y2, w: w2, h: h2, angle: angle2 },
2237
2346
  viewScaleInfo,
2238
2347
  viewSizeInfo,
2348
+ parentOpacity,
2239
2349
  renderContent: () => {
2240
2350
  const { x: x3, y: y3, w: w3, h: h3, radiusList } = calcViewBoxSize(viewElem, {
2241
2351
  viewScaleInfo,
@@ -2276,26 +2386,27 @@ var __privateMethod = (obj, member, method) => {
2276
2386
  }
2277
2387
  }
2278
2388
  try {
2279
- drawElement(ctx, child, Object.assign({}, opts));
2389
+ drawElement(ctx, child, Object.assign(Object.assign({}, opts), { parentOpacity: parentOpacity * getOpacity(elem) }));
2280
2390
  } catch (err) {
2281
2391
  console.error(err);
2282
2392
  }
2283
2393
  }
2284
2394
  }
2285
2395
  if (elem.detail.overflow === "hidden") {
2286
- ctx.globalAlpha = 1;
2287
2396
  ctx.restore();
2288
2397
  }
2289
2398
  }
2290
2399
  });
2291
2400
  }
2292
2401
  });
2402
+ ctx.globalAlpha = parentOpacity;
2293
2403
  });
2294
2404
  }
2295
2405
  const defaultDetail = getDefaultElementDetailConfig();
2296
2406
  function drawElementList(ctx, data, opts) {
2297
2407
  var _a;
2298
2408
  const { elements = [] } = data;
2409
+ const { parentOpacity } = opts;
2299
2410
  for (let i = 0; i < elements.length; i++) {
2300
2411
  const element = elements[i];
2301
2412
  const elem = Object.assign(Object.assign({}, element), {
@@ -2307,7 +2418,9 @@ var __privateMethod = (obj, member, method) => {
2307
2418
  }
2308
2419
  }
2309
2420
  try {
2310
- drawElement(ctx, elem, opts);
2421
+ drawElement(ctx, elem, Object.assign(Object.assign({}, opts), {
2422
+ parentOpacity
2423
+ }));
2311
2424
  } catch (err) {
2312
2425
  console.error(err);
2313
2426
  }
@@ -2340,6 +2453,23 @@ var __privateMethod = (obj, member, method) => {
2340
2453
  step((generator = generator.apply(thisArg, _arguments || [])).next());
2341
2454
  });
2342
2455
  };
2456
+ var __classPrivateFieldGet$2 = function(receiver, state, kind, f) {
2457
+ if (kind === "a" && !f)
2458
+ throw new TypeError("Private accessor was defined without a getter");
2459
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2460
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
2461
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2462
+ };
2463
+ var __classPrivateFieldSet$2 = function(receiver, state, value, kind, f) {
2464
+ if (kind === "m")
2465
+ throw new TypeError("Private method is not writable");
2466
+ if (kind === "a" && !f)
2467
+ throw new TypeError("Private accessor was defined without a setter");
2468
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2469
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
2470
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
2471
+ };
2472
+ var _Loader_instances, _Loader_loadFuncMap, _Loader_currentLoadItemMap, _Loader_storageLoadItemMap, _Loader_registerLoadFunc, _Loader_getLoadElementSource, _Loader_createLoadItem, _Loader_emitLoad, _Loader_emitError, _Loader_loadResource, _Loader_isExistingErrorStorage;
2343
2473
  const supportElementTypes = ["image", "svg", "html"];
2344
2474
  const getAssetIdFromElement = (element) => {
2345
2475
  var _a, _b, _c;
@@ -2362,10 +2492,11 @@ var __privateMethod = (obj, member, method) => {
2362
2492
  class Loader extends EventEmitter {
2363
2493
  constructor() {
2364
2494
  super();
2365
- this._loadFuncMap = {};
2366
- this._currentLoadItemMap = {};
2367
- this._storageLoadItemMap = {};
2368
- this._registerLoadFunc("image", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2495
+ _Loader_instances.add(this);
2496
+ _Loader_loadFuncMap.set(this, {});
2497
+ _Loader_currentLoadItemMap.set(this, {});
2498
+ _Loader_storageLoadItemMap.set(this, {});
2499
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_registerLoadFunc).call(this, "image", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2369
2500
  var _a;
2370
2501
  const src = ((_a = assets[elem.detail.src]) === null || _a === void 0 ? void 0 : _a.value) || elem.detail.src;
2371
2502
  const content = yield loadImage(src);
@@ -2375,12 +2506,12 @@ var __privateMethod = (obj, member, method) => {
2375
2506
  content
2376
2507
  };
2377
2508
  }));
2378
- this._registerLoadFunc("html", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2509
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_registerLoadFunc).call(this, "html", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2379
2510
  var _b;
2380
2511
  const html2 = ((_b = assets[elem.detail.html]) === null || _b === void 0 ? void 0 : _b.value) || elem.detail.html;
2381
2512
  const content = yield loadHTML(html2, {
2382
- width: elem.detail.width || elem.w,
2383
- height: elem.detail.height || elem.h
2513
+ width: elem.detail.originW || elem.w,
2514
+ height: elem.detail.originH || elem.h
2384
2515
  });
2385
2516
  return {
2386
2517
  uuid: elem.uuid,
@@ -2388,7 +2519,7 @@ var __privateMethod = (obj, member, method) => {
2388
2519
  content
2389
2520
  };
2390
2521
  }));
2391
- this._registerLoadFunc("svg", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2522
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_registerLoadFunc).call(this, "svg", (elem, assets) => __awaiter(this, void 0, void 0, function* () {
2392
2523
  var _c;
2393
2524
  const svg2 = ((_c = assets[elem.detail.svg]) === null || _c === void 0 ? void 0 : _c.value) || elem.detail.svg;
2394
2525
  const content = yield loadSVG(svg2);
@@ -2399,102 +2530,102 @@ var __privateMethod = (obj, member, method) => {
2399
2530
  };
2400
2531
  }));
2401
2532
  }
2402
- _registerLoadFunc(type, func) {
2403
- this._loadFuncMap[type] = func;
2404
- }
2405
- _getLoadElementSource(element) {
2406
- var _a, _b, _c;
2407
- let source = null;
2408
- if (element.type === "image") {
2409
- source = ((_a = element === null || element === void 0 ? void 0 : element.detail) === null || _a === void 0 ? void 0 : _a.src) || null;
2410
- } else if (element.type === "svg") {
2411
- source = ((_b = element === null || element === void 0 ? void 0 : element.detail) === null || _b === void 0 ? void 0 : _b.svg) || null;
2412
- } else if (element.type === "html") {
2413
- source = ((_c = element === null || element === void 0 ? void 0 : element.detail) === null || _c === void 0 ? void 0 : _c.html) || null;
2414
- }
2415
- return source;
2416
- }
2417
- _createLoadItem(element) {
2418
- return {
2419
- element,
2420
- status: "null",
2421
- content: null,
2422
- error: null,
2423
- startTime: -1,
2424
- endTime: -1,
2425
- source: this._getLoadElementSource(element)
2426
- };
2427
- }
2428
- _emitLoad(item) {
2429
- const assetId = getAssetIdFromElement(item.element);
2430
- const storageItem = this._storageLoadItemMap[assetId];
2431
- if (storageItem) {
2432
- if (storageItem.startTime < item.startTime) {
2433
- this._storageLoadItemMap[assetId] = item;
2434
- this.trigger("load", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2435
- }
2436
- } else {
2437
- this._storageLoadItemMap[assetId] = item;
2438
- this.trigger("load", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2439
- }
2440
- }
2441
- _emitError(item) {
2442
- const assetId = getAssetIdFromElement(item.element);
2443
- const storageItem = this._storageLoadItemMap[assetId];
2444
- if (storageItem) {
2445
- if (storageItem.startTime < item.startTime) {
2446
- this._storageLoadItemMap[assetId] = item;
2447
- this.trigger("error", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2448
- }
2449
- } else {
2450
- this._storageLoadItemMap[assetId] = item;
2451
- this.trigger("error", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2452
- }
2453
- }
2454
- _loadResource(element, assets) {
2455
- const item = this._createLoadItem(element);
2456
- const assetId = getAssetIdFromElement(element);
2457
- this._currentLoadItemMap[assetId] = item;
2458
- const loadFunc = this._loadFuncMap[element.type];
2459
- if (typeof loadFunc === "function") {
2460
- item.startTime = Date.now();
2461
- loadFunc(element, assets).then((result) => {
2462
- item.content = result.content;
2463
- item.endTime = Date.now();
2464
- item.status = "load";
2465
- this._emitLoad(item);
2466
- }).catch((err) => {
2467
- console.warn(`Load element source "${item.source}" fail`, err, element);
2468
- item.endTime = Date.now();
2469
- item.status = "error";
2470
- item.error = err;
2471
- this._emitError(item);
2472
- });
2473
- }
2474
- }
2475
- _isExistingErrorStorage(element) {
2476
- var _a;
2477
- const assetId = getAssetIdFromElement(element);
2478
- const existItem = (_a = this._currentLoadItemMap) === null || _a === void 0 ? void 0 : _a[assetId];
2479
- if (existItem && existItem.status === "error" && existItem.source && existItem.source === this._getLoadElementSource(element)) {
2480
- return true;
2481
- }
2482
- return false;
2483
- }
2484
2533
  load(element, assets) {
2485
- if (this._isExistingErrorStorage(element)) {
2534
+ if (__classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_isExistingErrorStorage).call(this, element)) {
2486
2535
  return;
2487
2536
  }
2488
2537
  if (supportElementTypes.includes(element.type)) {
2489
- this._loadResource(element, assets);
2538
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_loadResource).call(this, element, assets);
2490
2539
  }
2491
2540
  }
2492
2541
  getContent(element) {
2493
2542
  var _a, _b;
2494
2543
  const assetId = getAssetIdFromElement(element);
2495
- return ((_b = (_a = this._storageLoadItemMap) === null || _a === void 0 ? void 0 : _a[assetId]) === null || _b === void 0 ? void 0 : _b.content) || null;
2544
+ return ((_b = (_a = __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")) === null || _a === void 0 ? void 0 : _a[assetId]) === null || _b === void 0 ? void 0 : _b.content) || null;
2545
+ }
2546
+ getLoadItemMap() {
2547
+ return __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f");
2548
+ }
2549
+ setLoadItemMap(itemMap) {
2550
+ __classPrivateFieldSet$2(this, _Loader_storageLoadItemMap, itemMap, "f");
2496
2551
  }
2497
2552
  }
2553
+ _Loader_loadFuncMap = /* @__PURE__ */ new WeakMap(), _Loader_currentLoadItemMap = /* @__PURE__ */ new WeakMap(), _Loader_storageLoadItemMap = /* @__PURE__ */ new WeakMap(), _Loader_instances = /* @__PURE__ */ new WeakSet(), _Loader_registerLoadFunc = function _Loader_registerLoadFunc2(type, func) {
2554
+ __classPrivateFieldGet$2(this, _Loader_loadFuncMap, "f")[type] = func;
2555
+ }, _Loader_getLoadElementSource = function _Loader_getLoadElementSource2(element) {
2556
+ var _a, _b, _c;
2557
+ let source = null;
2558
+ if (element.type === "image") {
2559
+ source = ((_a = element === null || element === void 0 ? void 0 : element.detail) === null || _a === void 0 ? void 0 : _a.src) || null;
2560
+ } else if (element.type === "svg") {
2561
+ source = ((_b = element === null || element === void 0 ? void 0 : element.detail) === null || _b === void 0 ? void 0 : _b.svg) || null;
2562
+ } else if (element.type === "html") {
2563
+ source = ((_c = element === null || element === void 0 ? void 0 : element.detail) === null || _c === void 0 ? void 0 : _c.html) || null;
2564
+ }
2565
+ return source;
2566
+ }, _Loader_createLoadItem = function _Loader_createLoadItem2(element) {
2567
+ return {
2568
+ element,
2569
+ status: "null",
2570
+ content: null,
2571
+ error: null,
2572
+ startTime: -1,
2573
+ endTime: -1,
2574
+ source: __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_getLoadElementSource).call(this, element)
2575
+ };
2576
+ }, _Loader_emitLoad = function _Loader_emitLoad2(item) {
2577
+ const assetId = getAssetIdFromElement(item.element);
2578
+ const storageItem = __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId];
2579
+ if (storageItem) {
2580
+ if (storageItem.startTime < item.startTime) {
2581
+ __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId] = item;
2582
+ this.trigger("load", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2583
+ }
2584
+ } else {
2585
+ __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId] = item;
2586
+ this.trigger("load", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2587
+ }
2588
+ }, _Loader_emitError = function _Loader_emitError2(item) {
2589
+ const assetId = getAssetIdFromElement(item.element);
2590
+ const storageItem = __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId];
2591
+ if (storageItem) {
2592
+ if (storageItem.startTime < item.startTime) {
2593
+ __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId] = item;
2594
+ this.trigger("error", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2595
+ }
2596
+ } else {
2597
+ __classPrivateFieldGet$2(this, _Loader_storageLoadItemMap, "f")[assetId] = item;
2598
+ this.trigger("error", Object.assign(Object.assign({}, item), { countTime: item.endTime - item.startTime }));
2599
+ }
2600
+ }, _Loader_loadResource = function _Loader_loadResource2(element, assets) {
2601
+ const item = __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_createLoadItem).call(this, element);
2602
+ const assetId = getAssetIdFromElement(element);
2603
+ __classPrivateFieldGet$2(this, _Loader_currentLoadItemMap, "f")[assetId] = item;
2604
+ const loadFunc = __classPrivateFieldGet$2(this, _Loader_loadFuncMap, "f")[element.type];
2605
+ if (typeof loadFunc === "function") {
2606
+ item.startTime = Date.now();
2607
+ loadFunc(element, assets).then((result) => {
2608
+ item.content = result.content;
2609
+ item.endTime = Date.now();
2610
+ item.status = "load";
2611
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_emitLoad).call(this, item);
2612
+ }).catch((err) => {
2613
+ console.warn(`Load element source "${item.source}" fail`, err, element);
2614
+ item.endTime = Date.now();
2615
+ item.status = "error";
2616
+ item.error = err;
2617
+ __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_emitError).call(this, item);
2618
+ });
2619
+ }
2620
+ }, _Loader_isExistingErrorStorage = function _Loader_isExistingErrorStorage2(element) {
2621
+ var _a;
2622
+ const assetId = getAssetIdFromElement(element);
2623
+ const existItem = (_a = __classPrivateFieldGet$2(this, _Loader_currentLoadItemMap, "f")) === null || _a === void 0 ? void 0 : _a[assetId];
2624
+ if (existItem && existItem.status === "error" && existItem.source && existItem.source === __classPrivateFieldGet$2(this, _Loader_instances, "m", _Loader_getLoadElementSource).call(this, element)) {
2625
+ return true;
2626
+ }
2627
+ return false;
2628
+ };
2498
2629
  var __classPrivateFieldSet$1 = function(receiver, state, value, kind, f) {
2499
2630
  if (kind === "m")
2500
2631
  throw new TypeError("Private method is not writable");
@@ -2539,7 +2670,8 @@ var __privateMethod = (obj, member, method) => {
2539
2670
  loader,
2540
2671
  calculator,
2541
2672
  parentElementSize,
2542
- elementAssets: data.assets
2673
+ elementAssets: data.assets,
2674
+ parentOpacity: 1
2543
2675
  }, opts));
2544
2676
  }
2545
2677
  scale(num) {
@@ -2567,6 +2699,12 @@ var __privateMethod = (obj, member, method) => {
2567
2699
  });
2568
2700
  }
2569
2701
  }
2702
+ setLoadItemMap(itemMap) {
2703
+ __classPrivateFieldGet$1(this, _Renderer_loader, "f").setLoadItemMap(itemMap);
2704
+ }
2705
+ getLoadItemMap() {
2706
+ return __classPrivateFieldGet$1(this, _Renderer_loader, "f").getLoadItemMap();
2707
+ }
2570
2708
  }
2571
2709
  _Renderer_opts = /* @__PURE__ */ new WeakMap(), _Renderer_loader = /* @__PURE__ */ new WeakMap(), _Renderer_instances = /* @__PURE__ */ new WeakSet(), _Renderer_init = function _Renderer_init2() {
2572
2710
  const loader = __classPrivateFieldGet$1(this, _Renderer_loader, "f");
@@ -2682,6 +2820,7 @@ var __privateMethod = (obj, member, method) => {
2682
2820
  return;
2683
2821
  }
2684
2822
  e.preventDefault();
2823
+ e.stopPropagation();
2685
2824
  const deltaX = e.deltaX > 0 || e.deltaX < 0 ? e.deltaX : 0;
2686
2825
  const deltaY = e.deltaY > 0 || e.deltaY < 0 ? e.deltaY : 0;
2687
2826
  if (e.ctrlKey === true && this.has("wheelScale")) {
@@ -2956,7 +3095,7 @@ var __privateMethod = (obj, member, method) => {
2956
3095
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
2957
3096
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2958
3097
  };
2959
- var _Board_instances, _Board_opts, _Board_middlewareMap, _Board_middlewares, _Board_activeMiddlewareObjs, _Board_watcher, _Board_sharer, _Board_viewer, _Board_calculator, _Board_eventHub, _Board_init, _Board_handlePointStart, _Board_handlePointEnd, _Board_handlePointMove, _Board_handleHover, _Board_handleDoubleClick, _Board_handleWheel, _Board_handleWheelScale, _Board_handleScrollX, _Board_handleScrollY, _Board_handleResize, _Board_handleClear, _Board_handleBeforeDrawFrame, _Board_handleAfterDrawFrame, _Board_resetActiveMiddlewareObjs;
3098
+ var _Board_instances, _Board_opts, _Board_middlewareMap, _Board_middlewares, _Board_activeMiddlewareObjs, _Board_watcher, _Board_renderer, _Board_sharer, _Board_viewer, _Board_calculator, _Board_eventHub, _Board_init, _Board_handlePointStart, _Board_handlePointEnd, _Board_handlePointMove, _Board_handleHover, _Board_handleDoubleClick, _Board_handleWheel, _Board_handleWheelScale, _Board_handleScrollX, _Board_handleScrollY, _Board_handleResize, _Board_handleClear, _Board_handleBeforeDrawFrame, _Board_handleAfterDrawFrame, _Board_resetActiveMiddlewareObjs;
2960
3099
  const throttleTime = 10;
2961
3100
  class Board {
2962
3101
  constructor(opts) {
@@ -2966,6 +3105,7 @@ var __privateMethod = (obj, member, method) => {
2966
3105
  _Board_middlewares.set(this, []);
2967
3106
  _Board_activeMiddlewareObjs.set(this, []);
2968
3107
  _Board_watcher.set(this, void 0);
3108
+ _Board_renderer.set(this, void 0);
2969
3109
  _Board_sharer.set(this, void 0);
2970
3110
  _Board_viewer.set(this, void 0);
2971
3111
  _Board_calculator.set(this, void 0);
@@ -2985,6 +3125,7 @@ var __privateMethod = (obj, member, method) => {
2985
3125
  __classPrivateFieldSet(this, _Board_opts, opts, "f");
2986
3126
  __classPrivateFieldSet(this, _Board_sharer, sharer, "f");
2987
3127
  __classPrivateFieldSet(this, _Board_watcher, watcher, "f");
3128
+ __classPrivateFieldSet(this, _Board_renderer, renderer, "f");
2988
3129
  __classPrivateFieldSet(this, _Board_calculator, calculator, "f");
2989
3130
  __classPrivateFieldSet(this, _Board_viewer, new Viewer({
2990
3131
  boardContent: opts.boardContent,
@@ -3007,6 +3148,9 @@ var __privateMethod = (obj, member, method) => {
3007
3148
  getViewer() {
3008
3149
  return __classPrivateFieldGet(this, _Board_viewer, "f");
3009
3150
  }
3151
+ getRenderer() {
3152
+ return __classPrivateFieldGet(this, _Board_renderer, "f");
3153
+ }
3010
3154
  setData(data) {
3011
3155
  const sharer = __classPrivateFieldGet(this, _Board_sharer, "f");
3012
3156
  __classPrivateFieldGet(this, _Board_sharer, "f").setActiveStorage("data", data);
@@ -3080,6 +3224,7 @@ var __privateMethod = (obj, member, method) => {
3080
3224
  boardContent.viewContext.$resize({ width, height, devicePixelRatio });
3081
3225
  boardContent.helperContext.$resize({ width, height, devicePixelRatio });
3082
3226
  boardContent.boardContext.$resize({ width, height, devicePixelRatio });
3227
+ boardContent.underContext.$resize({ width, height, devicePixelRatio });
3083
3228
  __classPrivateFieldGet(this, _Board_viewer, "f").drawFrame();
3084
3229
  __classPrivateFieldGet(this, _Board_watcher, "f").trigger("resize", viewSize);
3085
3230
  __classPrivateFieldGet(this, _Board_sharer, "f").setActiveViewSizeInfo(newViewSize);
@@ -3097,7 +3242,7 @@ var __privateMethod = (obj, member, method) => {
3097
3242
  return __classPrivateFieldGet(this, _Board_eventHub, "f");
3098
3243
  }
3099
3244
  }
3100
- _Board_opts = /* @__PURE__ */ new WeakMap(), _Board_middlewareMap = /* @__PURE__ */ new WeakMap(), _Board_middlewares = /* @__PURE__ */ new WeakMap(), _Board_activeMiddlewareObjs = /* @__PURE__ */ new WeakMap(), _Board_watcher = /* @__PURE__ */ new WeakMap(), _Board_sharer = /* @__PURE__ */ new WeakMap(), _Board_viewer = /* @__PURE__ */ new WeakMap(), _Board_calculator = /* @__PURE__ */ new WeakMap(), _Board_eventHub = /* @__PURE__ */ new WeakMap(), _Board_instances = /* @__PURE__ */ new WeakSet(), _Board_init = function _Board_init2() {
3245
+ _Board_opts = /* @__PURE__ */ new WeakMap(), _Board_middlewareMap = /* @__PURE__ */ new WeakMap(), _Board_middlewares = /* @__PURE__ */ new WeakMap(), _Board_activeMiddlewareObjs = /* @__PURE__ */ new WeakMap(), _Board_watcher = /* @__PURE__ */ new WeakMap(), _Board_renderer = /* @__PURE__ */ new WeakMap(), _Board_sharer = /* @__PURE__ */ new WeakMap(), _Board_viewer = /* @__PURE__ */ new WeakMap(), _Board_calculator = /* @__PURE__ */ new WeakMap(), _Board_eventHub = /* @__PURE__ */ new WeakMap(), _Board_instances = /* @__PURE__ */ new WeakSet(), _Board_init = function _Board_init2() {
3101
3246
  __classPrivateFieldGet(this, _Board_watcher, "f").on("pointStart", __classPrivateFieldGet(this, _Board_instances, "m", _Board_handlePointStart).bind(this));
3102
3247
  __classPrivateFieldGet(this, _Board_watcher, "f").on("pointEnd", __classPrivateFieldGet(this, _Board_instances, "m", _Board_handlePointEnd).bind(this));
3103
3248
  __classPrivateFieldGet(this, _Board_watcher, "f").on("pointMove", throttle((e) => {
@@ -4591,6 +4736,7 @@ var __privateMethod = (obj, member, method) => {
4591
4736
  viewer.drawFrame();
4592
4737
  },
4593
4738
  pointMove: (e) => {
4739
+ var _a;
4594
4740
  const data = sharer.getActiveStorage("data");
4595
4741
  const elems = getActiveElements();
4596
4742
  const scale = sharer.getActiveStorage("scale") || 1;
@@ -4645,8 +4791,15 @@ var __privateMethod = (obj, member, method) => {
4645
4791
  const resizedElemSize = resizeElement(elems[0], { scale, start: resizeStart, end: resizeEnd, resizeType, sharer });
4646
4792
  elems[0].x = resizedElemSize.x;
4647
4793
  elems[0].y = resizedElemSize.y;
4648
- elems[0].w = resizedElemSize.w;
4649
- elems[0].h = resizedElemSize.h;
4794
+ if (elems[0].type === "group" && ((_a = elems[0].operations) == null ? void 0 : _a.deepResize) === true) {
4795
+ deepResizeGroupElement(elems[0], {
4796
+ w: resizedElemSize.w,
4797
+ h: resizedElemSize.h
4798
+ });
4799
+ } else {
4800
+ elems[0].w = resizedElemSize.w;
4801
+ elems[0].h = resizedElemSize.h;
4802
+ }
4650
4803
  updateSelectedElementList([elems[0]]);
4651
4804
  viewer.drawFrame();
4652
4805
  }
@@ -4718,7 +4871,8 @@ var __privateMethod = (obj, member, method) => {
4718
4871
  sharer.setActiveStorage("contextWidth", viewInfo.contextSize.contextWidth);
4719
4872
  }
4720
4873
  if (data && ["drag", "drag-list", "drag-list-end", "resize"].includes(actionType)) {
4721
- eventHub.trigger("change", { data });
4874
+ let type = "drag-element";
4875
+ eventHub.trigger("change", { data, type });
4722
4876
  }
4723
4877
  viewer.drawFrame();
4724
4878
  };
@@ -5468,6 +5622,9 @@ var __privateMethod = (obj, member, method) => {
5468
5622
  setViewScale(opts) {
5469
5623
  __privateGet(this, _board).updateViewScaleInfo(opts);
5470
5624
  }
5625
+ getLoadItemMap() {
5626
+ return __privateGet(this, _board).getRenderer().getLoadItemMap();
5627
+ }
5471
5628
  }
5472
5629
  _board = new WeakMap();
5473
5630
  _container = new WeakMap();