@leafer-ui/worker 1.10.1 → 1.11.0
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/worker.js +54 -34
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +55 -35
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/worker.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.0";
|
|
6432
6451
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6433
6452
|
get allowBackgroundColor() {
|
|
6434
6453
|
return true;
|
|
@@ -7344,7 +7363,9 @@ var LeaferUI = function(exports) {
|
|
|
7344
7363
|
};
|
|
7345
7364
|
const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
7346
7365
|
const {stintSet: stintSet$3} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
7347
|
-
const emptyPaint = {
|
|
7366
|
+
const emptyPaint = {
|
|
7367
|
+
originPaint: {}
|
|
7368
|
+
};
|
|
7348
7369
|
const debug$2 = Debug.get("UIData");
|
|
7349
7370
|
class UIData extends LeafData {
|
|
7350
7371
|
get scale() {
|
|
@@ -8449,7 +8470,7 @@ var LeaferUI = function(exports) {
|
|
|
8449
8470
|
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
8450
8471
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
8451
8472
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
8452
|
-
if (isScrollMode = overflow.includes("scroll")) {
|
|
8473
|
+
if (isScrollMode = overflow && overflow.includes("scroll")) {
|
|
8453
8474
|
add(childrenRenderBounds, boxBounds);
|
|
8454
8475
|
scroll(childrenRenderBounds, data);
|
|
8455
8476
|
}
|
|
@@ -9458,10 +9479,12 @@ var LeaferUI = function(exports) {
|
|
|
9458
9479
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
9459
9480
|
this.dragData.path = path;
|
|
9460
9481
|
if (this.moving) {
|
|
9482
|
+
data.moving = true;
|
|
9461
9483
|
this.dragData.moveType = "drag";
|
|
9462
9484
|
interaction.emit(exports.MoveEvent.BEFORE_MOVE, this.dragData);
|
|
9463
9485
|
interaction.emit(exports.MoveEvent.MOVE, this.dragData);
|
|
9464
9486
|
} else if (this.dragging) {
|
|
9487
|
+
data.dragging = true;
|
|
9465
9488
|
this.dragReal();
|
|
9466
9489
|
interaction.emit(exports.DragEvent.BEFORE_DRAG, this.dragData);
|
|
9467
9490
|
interaction.emit(exports.DragEvent.DRAG, this.dragData);
|
|
@@ -9566,13 +9589,9 @@ var LeaferUI = function(exports) {
|
|
|
9566
9589
|
if (!path && !data.path) return;
|
|
9567
9590
|
let leaf;
|
|
9568
9591
|
data.type = type;
|
|
9569
|
-
if (path) {
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
});
|
|
9573
|
-
} else {
|
|
9574
|
-
path = data.path;
|
|
9575
|
-
}
|
|
9592
|
+
if (path) data = Object.assign(Object.assign({}, data), {
|
|
9593
|
+
path: path
|
|
9594
|
+
}); else path = data.path;
|
|
9576
9595
|
data.target = path.indexAt(0);
|
|
9577
9596
|
try {
|
|
9578
9597
|
for (let i = path.length - 1; i > -1; i--) {
|
|
@@ -11884,6 +11903,7 @@ var LeaferUI = function(exports) {
|
|
|
11884
11903
|
exports.PathBounds = PathBounds;
|
|
11885
11904
|
exports.PathCommandDataHelper = PathCommandDataHelper;
|
|
11886
11905
|
exports.PathCommandMap = PathCommandMap;
|
|
11906
|
+
exports.PathCommandNodeHelper = PathCommandNodeHelper;
|
|
11887
11907
|
exports.PathConvert = PathConvert;
|
|
11888
11908
|
exports.PathCorner = PathCorner;
|
|
11889
11909
|
exports.PathCreator = PathCreator;
|