leafer-ui 1.10.1 → 1.11.1
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 +54 -34
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +55 -35
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -831,9 +831,10 @@ var LeaferUI = function(exports) {
|
|
|
831
831
|
getAtan2(t, to) {
|
|
832
832
|
return atan2$2(to.y - t.y, to.x - t.x);
|
|
833
833
|
},
|
|
834
|
-
getDistancePoint(t, to, distance, changeTo) {
|
|
834
|
+
getDistancePoint(t, to, distance, changeTo, fromTo) {
|
|
835
835
|
const r = getAtan2(t, to);
|
|
836
|
-
|
|
836
|
+
fromTo && (t = to);
|
|
837
|
+
changeTo || (to = {});
|
|
837
838
|
to.x = t.x + cos$4(r) * distance;
|
|
838
839
|
to.y = t.y + sin$4(r) * distance;
|
|
839
840
|
return to;
|
|
@@ -843,6 +844,9 @@ var LeaferUI = function(exports) {
|
|
|
843
844
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
844
845
|
return points;
|
|
845
846
|
},
|
|
847
|
+
isSame(t, point) {
|
|
848
|
+
return t.x === point.x && t.y === point.y;
|
|
849
|
+
},
|
|
846
850
|
reset(t) {
|
|
847
851
|
P$5.reset(t);
|
|
848
852
|
}
|
|
@@ -904,8 +908,8 @@ var LeaferUI = function(exports) {
|
|
|
904
908
|
getDistance(to) {
|
|
905
909
|
return PointHelper.getDistance(this, to);
|
|
906
910
|
}
|
|
907
|
-
getDistancePoint(to, distance, changeTo) {
|
|
908
|
-
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo));
|
|
911
|
+
getDistancePoint(to, distance, changeTo, fromTo) {
|
|
912
|
+
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
|
|
909
913
|
}
|
|
910
914
|
getAngle(to) {
|
|
911
915
|
return PointHelper.getAngle(this, to);
|
|
@@ -913,6 +917,9 @@ var LeaferUI = function(exports) {
|
|
|
913
917
|
getAtan2(to) {
|
|
914
918
|
return PointHelper.getAtan2(this, to);
|
|
915
919
|
}
|
|
920
|
+
isSame(point) {
|
|
921
|
+
return PointHelper.isSame(this, point);
|
|
922
|
+
}
|
|
916
923
|
reset() {
|
|
917
924
|
PointHelper.reset(this);
|
|
918
925
|
return this;
|
|
@@ -2689,6 +2696,14 @@ var LeaferUI = function(exports) {
|
|
|
2689
2696
|
}
|
|
2690
2697
|
}
|
|
2691
2698
|
};
|
|
2699
|
+
const PathCommandNodeHelper = {
|
|
2700
|
+
toCommand(_nodes) {
|
|
2701
|
+
return [];
|
|
2702
|
+
},
|
|
2703
|
+
toNode(_data) {
|
|
2704
|
+
return [];
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2692
2707
|
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$4, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2693
2708
|
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2694
2709
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
@@ -2962,30 +2977,34 @@ var LeaferUI = function(exports) {
|
|
|
2962
2977
|
return data;
|
|
2963
2978
|
},
|
|
2964
2979
|
objectToCanvasData(list) {
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2980
|
+
if (list[0].name.length > 1) {
|
|
2981
|
+
return PathCommandNodeHelper.toCommand(list);
|
|
2982
|
+
} else {
|
|
2983
|
+
const data = [];
|
|
2984
|
+
list.forEach(item => {
|
|
2985
|
+
switch (item.name) {
|
|
2986
|
+
case "M":
|
|
2987
|
+
data.push(M$4, item.x, item.y);
|
|
2988
|
+
break;
|
|
2971
2989
|
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2990
|
+
case "L":
|
|
2991
|
+
data.push(L$5, item.x, item.y);
|
|
2992
|
+
break;
|
|
2975
2993
|
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2994
|
+
case "C":
|
|
2995
|
+
data.push(C$3, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2996
|
+
break;
|
|
2979
2997
|
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2998
|
+
case "Q":
|
|
2999
|
+
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
3000
|
+
break;
|
|
2983
3001
|
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
3002
|
+
case "Z":
|
|
3003
|
+
data.push(Z$4);
|
|
3004
|
+
}
|
|
3005
|
+
});
|
|
3006
|
+
return data;
|
|
3007
|
+
}
|
|
2989
3008
|
},
|
|
2990
3009
|
copyData(data, old, index, count) {
|
|
2991
3010
|
for (let i = index, end = index + count; i < end; i++) {
|
|
@@ -6428,7 +6447,7 @@ var LeaferUI = function(exports) {
|
|
|
6428
6447
|
this.levelMap = null;
|
|
6429
6448
|
}
|
|
6430
6449
|
}
|
|
6431
|
-
const version = "1.
|
|
6450
|
+
const version = "1.11.1";
|
|
6432
6451
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6433
6452
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6434
6453
|
set zIndex(zIndex) {
|
|
@@ -7550,7 +7569,9 @@ var LeaferUI = function(exports) {
|
|
|
7550
7569
|
};
|
|
7551
7570
|
const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
7552
7571
|
const {stintSet: stintSet$3} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
7553
|
-
const emptyPaint = {
|
|
7572
|
+
const emptyPaint = {
|
|
7573
|
+
originPaint: {}
|
|
7574
|
+
};
|
|
7554
7575
|
const debug$2 = Debug.get("UIData");
|
|
7555
7576
|
class UIData extends LeafData {
|
|
7556
7577
|
get scale() {
|
|
@@ -8655,7 +8676,7 @@ var LeaferUI = function(exports) {
|
|
|
8655
8676
|
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
8656
8677
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
8657
8678
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
8658
|
-
if (isScrollMode = overflow.includes("scroll")) {
|
|
8679
|
+
if (isScrollMode = overflow && overflow.includes("scroll")) {
|
|
8659
8680
|
add(childrenRenderBounds, boxBounds);
|
|
8660
8681
|
scroll(childrenRenderBounds, data);
|
|
8661
8682
|
}
|
|
@@ -9664,10 +9685,12 @@ var LeaferUI = function(exports) {
|
|
|
9664
9685
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
9665
9686
|
this.dragData.path = path;
|
|
9666
9687
|
if (this.moving) {
|
|
9688
|
+
data.moving = true;
|
|
9667
9689
|
this.dragData.moveType = "drag";
|
|
9668
9690
|
interaction.emit(exports.MoveEvent.BEFORE_MOVE, this.dragData);
|
|
9669
9691
|
interaction.emit(exports.MoveEvent.MOVE, this.dragData);
|
|
9670
9692
|
} else if (this.dragging) {
|
|
9693
|
+
data.dragging = true;
|
|
9671
9694
|
this.dragReal();
|
|
9672
9695
|
interaction.emit(exports.DragEvent.BEFORE_DRAG, this.dragData);
|
|
9673
9696
|
interaction.emit(exports.DragEvent.DRAG, this.dragData);
|
|
@@ -9772,13 +9795,9 @@ var LeaferUI = function(exports) {
|
|
|
9772
9795
|
if (!path && !data.path) return;
|
|
9773
9796
|
let leaf;
|
|
9774
9797
|
data.type = type;
|
|
9775
|
-
if (path) {
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
});
|
|
9779
|
-
} else {
|
|
9780
|
-
path = data.path;
|
|
9781
|
-
}
|
|
9798
|
+
if (path) data = Object.assign(Object.assign({}, data), {
|
|
9799
|
+
path: path
|
|
9800
|
+
}); else path = data.path;
|
|
9782
9801
|
data.target = path.indexAt(0);
|
|
9783
9802
|
try {
|
|
9784
9803
|
for (let i = path.length - 1; i > -1; i--) {
|
|
@@ -12415,6 +12434,7 @@ var LeaferUI = function(exports) {
|
|
|
12415
12434
|
exports.PathBounds = PathBounds;
|
|
12416
12435
|
exports.PathCommandDataHelper = PathCommandDataHelper;
|
|
12417
12436
|
exports.PathCommandMap = PathCommandMap;
|
|
12437
|
+
exports.PathCommandNodeHelper = PathCommandNodeHelper;
|
|
12418
12438
|
exports.PathConvert = PathConvert;
|
|
12419
12439
|
exports.PathCorner = PathCorner;
|
|
12420
12440
|
exports.PathCreator = PathCreator;
|