@leafer-ui/miniapp 2.1.10 → 2.1.11

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.
@@ -1256,7 +1256,6 @@ const BoundsHelper = {
1256
1256
  },
1257
1257
  copyAndSpread(t, bounds, spread, isShrink, side) {
1258
1258
  const {x: x, y: y, width: width, height: height} = bounds;
1259
- if (!spread) spread = 0;
1260
1259
  if (isArray(spread)) {
1261
1260
  const four = fourNumber(spread);
1262
1261
  isShrink ? B.set(t, x + four[3], y + four[0], width - four[1] - four[3], height - four[2] - four[0]) : B.set(t, x - four[3], y - four[0], width + four[1] + four[3], height + four[2] + four[0]);
@@ -3577,7 +3576,8 @@ const PathDrawer = {
3577
3576
  return;
3578
3577
  }
3579
3578
  }
3580
- }
3579
+ },
3580
+ drawPathByPoints(_drawer, _points, _closed) {}
3581
3581
  };
3582
3582
 
3583
3583
  const {M: M$1, L: L$2, C: C, Q: Q, Z: Z$1, N: N, D: D$1, X: X, G: G, F: F$1, O: O, P: P, U: U} = PathCommandMap;
@@ -6985,7 +6985,7 @@ class LeafLevelList {
6985
6985
  }
6986
6986
  }
6987
6987
 
6988
- const version = "2.1.10";
6988
+ const version = "2.1.11";
6989
6989
 
6990
6990
  class LeaferCanvas extends LeaferCanvasBase {
6991
6991
  get allowBackgroundColor() {
@@ -8688,8 +8688,9 @@ let UI = UI_1 = class UI extends Leaf {
8688
8688
  this.__drawPathByData(canvas, data.__pathForRender);
8689
8689
  }
8690
8690
  __drawPath(canvas) {
8691
+ const data = this.__;
8691
8692
  canvas.beginPath();
8692
- this.__drawPathByData(canvas, this.__.path, true);
8693
+ data.__usePointsMode ? PathDrawer.drawPathByPoints(canvas, data.points, data.closed) : this.__drawPathByData(canvas, data.path, true);
8693
8694
  }
8694
8695
  __drawPathByData(drawer, data, ignoreCornerRadius) {
8695
8696
  data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
@@ -9546,6 +9547,9 @@ let Polygon = class Polygon extends UI {
9546
9547
  get __tag() {
9547
9548
  return "Polygon";
9548
9549
  }
9550
+ get isPointsMode() {
9551
+ return this.points && !this.pathInputed;
9552
+ }
9549
9553
  __updatePath() {
9550
9554
  const data = this.__;
9551
9555
  const path = data.path = [];
@@ -9623,6 +9627,9 @@ let Line = class Line extends UI {
9623
9627
  get __tag() {
9624
9628
  return "Line";
9625
9629
  }
9630
+ get isPointsMode() {
9631
+ return this.points && !this.pathInputed;
9632
+ }
9626
9633
  get toPoint() {
9627
9634
  const {width: width, rotation: rotation} = this.__;
9628
9635
  const to = getPointData();