leafer-ui 2.0.6 → 2.0.8

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/dist/web.js CHANGED
@@ -2709,6 +2709,32 @@ var LeaferUI = function(exports) {
2709
2709
  getDerivative(t, fromV, v1, v2, toV) {
2710
2710
  const o = 1 - t;
2711
2711
  return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
2712
+ },
2713
+ cut(t, fromX, fromY, x1, y1, x2, y2, toX, toY) {
2714
+ if (t <= 0) return {
2715
+ left: null,
2716
+ right: [ x1, y1, x2, y2, toX, toY ]
2717
+ }; else if (t >= 1) return {
2718
+ left: [ x1, y1, x2, y2, toX, toY ],
2719
+ right: null
2720
+ };
2721
+ const u = 1 - t;
2722
+ const leftX1 = fromX * u + x1 * t;
2723
+ const leftY1 = fromY * u + y1 * t;
2724
+ const P12x = x1 * u + x2 * t;
2725
+ const P12y = y1 * u + y2 * t;
2726
+ const rightX2 = x2 * u + toX * t;
2727
+ const rightY2 = y2 * u + toY * t;
2728
+ const leftX2 = leftX1 * u + P12x * t;
2729
+ const leftY2 = leftY1 * u + P12y * t;
2730
+ const rightX1 = P12x * u + rightX2 * t;
2731
+ const rightY1 = P12y * u + rightY2 * t;
2732
+ const leftX = leftX2 * u + rightX1 * t;
2733
+ const leftY = leftY2 * u + rightY1 * t;
2734
+ return {
2735
+ left: [ leftX1, leftY1, leftX2, leftY2, leftX, leftY ],
2736
+ right: [ rightX1, rightY1, rightX2, rightY2, toX, toY ]
2737
+ };
2712
2738
  }
2713
2739
  };
2714
2740
  const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6} = BezierHelper;
@@ -6637,7 +6663,7 @@ var LeaferUI = function(exports) {
6637
6663
  this.levelMap = null;
6638
6664
  }
6639
6665
  }
6640
- const version = "2.0.6";
6666
+ const version = "2.0.8";
6641
6667
  const debug$5 = Debug.get("LeaferCanvas");
6642
6668
  class LeaferCanvas extends LeaferCanvasBase {
6643
6669
  set zIndex(zIndex) {
@@ -8280,7 +8306,7 @@ var LeaferUI = function(exports) {
8280
8306
  __updateRenderPath(updateCache) {
8281
8307
  const data = this.__;
8282
8308
  if (data.path) {
8283
- data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
8309
+ data.__pathForRender = data.cornerRadius || data.path.radius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
8284
8310
  if (data.__useArrow) PathArrow.addArrows(this, updateCache);
8285
8311
  } else data.__pathForRender && (data.__pathForRender = undefined);
8286
8312
  }
@@ -8999,7 +9025,7 @@ var LeaferUI = function(exports) {
8999
9025
  }
9000
9026
  }
9001
9027
  if (!open) closePath$2(path);
9002
- if (Platform.ellipseToCurve || data.__useArrow) data.path = this.getPath(true);
9028
+ if (Platform.ellipseToCurve || data.__useArrow || data.cornerRadius) data.path = this.getPath(true);
9003
9029
  }
9004
9030
  };
9005
9031
  __decorate([ dataProcessor(EllipseData) ], exports.Ellipse.prototype, "__", void 0);
@@ -9017,7 +9043,7 @@ var LeaferUI = function(exports) {
9017
9043
  const data = this.__;
9018
9044
  const path = data.path = [];
9019
9045
  if (data.points) {
9020
- drawPoints$1(path, data.points, data.curve, true);
9046
+ drawPoints$1(path, data.points, data.curve, data.closed);
9021
9047
  } else {
9022
9048
  const {width: width, height: height, sides: sides} = data;
9023
9049
  const rx = width / 2, ry = height / 2;