leafer-draw 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/web.js +49 -27
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +50 -28
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +3 -3
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$3, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2693
2708
|
const {rect: rect$2, 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
|
const debug$4 = Debug.get("LeaferCanvas");
|
|
6433
6452
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6434
6453
|
set zIndex(zIndex) {
|
|
@@ -7357,7 +7376,9 @@ var LeaferUI = function(exports) {
|
|
|
7357
7376
|
};
|
|
7358
7377
|
const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
7359
7378
|
const {stintSet: stintSet$3} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
7360
|
-
const emptyPaint = {
|
|
7379
|
+
const emptyPaint = {
|
|
7380
|
+
originPaint: {}
|
|
7381
|
+
};
|
|
7361
7382
|
const debug$1 = Debug.get("UIData");
|
|
7362
7383
|
class UIData extends LeafData {
|
|
7363
7384
|
get scale() {
|
|
@@ -8462,7 +8483,7 @@ var LeaferUI = function(exports) {
|
|
|
8462
8483
|
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
8463
8484
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
8464
8485
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
8465
|
-
if (isScrollMode = overflow.includes("scroll")) {
|
|
8486
|
+
if (isScrollMode = overflow && overflow.includes("scroll")) {
|
|
8466
8487
|
add(childrenRenderBounds, boxBounds);
|
|
8467
8488
|
scroll(childrenRenderBounds, data);
|
|
8468
8489
|
}
|
|
@@ -10510,6 +10531,7 @@ var LeaferUI = function(exports) {
|
|
|
10510
10531
|
exports.PathBounds = PathBounds;
|
|
10511
10532
|
exports.PathCommandDataHelper = PathCommandDataHelper;
|
|
10512
10533
|
exports.PathCommandMap = PathCommandMap;
|
|
10534
|
+
exports.PathCommandNodeHelper = PathCommandNodeHelper;
|
|
10513
10535
|
exports.PathConvert = PathConvert;
|
|
10514
10536
|
exports.PathCorner = PathCorner;
|
|
10515
10537
|
exports.PathCreator = PathCreator;
|