@leafer/miniapp 2.1.7 → 2.1.9
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/miniapp.module.js +143 -117
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +25 -25
package/dist/miniapp.module.js
CHANGED
|
@@ -784,24 +784,24 @@ const PointHelper = {
|
|
|
784
784
|
},
|
|
785
785
|
tempToInnerOf(t, matrix) {
|
|
786
786
|
const {tempPoint: temp} = P$7;
|
|
787
|
-
copy$
|
|
787
|
+
copy$d(temp, t);
|
|
788
788
|
toInnerPoint$2(matrix, temp, temp);
|
|
789
789
|
return temp;
|
|
790
790
|
},
|
|
791
791
|
tempToOuterOf(t, matrix) {
|
|
792
792
|
const {tempPoint: temp} = P$7;
|
|
793
|
-
copy$
|
|
793
|
+
copy$d(temp, t);
|
|
794
794
|
toOuterPoint$4(matrix, temp, temp);
|
|
795
795
|
return temp;
|
|
796
796
|
},
|
|
797
797
|
tempToInnerRadiusPointOf(t, matrix) {
|
|
798
798
|
const {tempRadiusPoint: temp} = P$7;
|
|
799
|
-
copy$
|
|
799
|
+
copy$d(temp, t);
|
|
800
800
|
P$7.toInnerRadiusPointOf(t, matrix, temp);
|
|
801
801
|
return temp;
|
|
802
802
|
},
|
|
803
803
|
copyRadiusPoint(t, point, x, y) {
|
|
804
|
-
copy$
|
|
804
|
+
copy$d(t, point);
|
|
805
805
|
setRadius(t, x, y);
|
|
806
806
|
return t;
|
|
807
807
|
},
|
|
@@ -881,7 +881,7 @@ const PointHelper = {
|
|
|
881
881
|
|
|
882
882
|
const P$7 = PointHelper;
|
|
883
883
|
|
|
884
|
-
const {getDistanceFrom: getDistanceFrom, copy: copy$
|
|
884
|
+
const {getDistanceFrom: getDistanceFrom, copy: copy$d, setRadius: setRadius, getAtan2: getAtan2} = P$7;
|
|
885
885
|
|
|
886
886
|
class Point {
|
|
887
887
|
constructor(x, y) {
|
|
@@ -913,12 +913,12 @@ class Point {
|
|
|
913
913
|
PointHelper.scaleOf(this, origin, scaleX, scaleY);
|
|
914
914
|
return this;
|
|
915
915
|
}
|
|
916
|
-
rotate(rotation, origin) {
|
|
917
|
-
PointHelper.rotate(this, rotation, origin);
|
|
916
|
+
rotate(rotation, origin, radiusX, radiusY) {
|
|
917
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
918
918
|
return this;
|
|
919
919
|
}
|
|
920
|
-
rotateOf(origin, rotation) {
|
|
921
|
-
PointHelper.rotate(this, rotation, origin);
|
|
920
|
+
rotateOf(origin, rotation, radiusX, radiusY) {
|
|
921
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
922
922
|
return this;
|
|
923
923
|
}
|
|
924
924
|
getRotation(origin, to, toOrigin) {
|
|
@@ -941,11 +941,11 @@ class Point {
|
|
|
941
941
|
getDistancePoint(to, distance, changeTo, fromTo) {
|
|
942
942
|
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
|
|
943
943
|
}
|
|
944
|
-
getAngle(to) {
|
|
945
|
-
return PointHelper.getAngle(this, to);
|
|
944
|
+
getAngle(to, radiusX, radiusY) {
|
|
945
|
+
return PointHelper.getAngle(this, to, radiusX, radiusY);
|
|
946
946
|
}
|
|
947
|
-
getAtan2(to) {
|
|
948
|
-
return PointHelper.getAtan2(this, to);
|
|
947
|
+
getAtan2(to, radiusX, radiusY) {
|
|
948
|
+
return PointHelper.getAtan2(this, to, radiusX, radiusY);
|
|
949
949
|
}
|
|
950
950
|
isSame(point, quick) {
|
|
951
951
|
return PointHelper.isSame(this, point, quick);
|
|
@@ -1088,7 +1088,7 @@ class Matrix {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
-
const tempMatrix$
|
|
1091
|
+
const tempMatrix$3 = new Matrix;
|
|
1092
1092
|
|
|
1093
1093
|
const TwoPointBoundsHelper = {
|
|
1094
1094
|
tempPointBounds: {},
|
|
@@ -1293,7 +1293,7 @@ const BoundsHelper = {
|
|
|
1293
1293
|
return t;
|
|
1294
1294
|
},
|
|
1295
1295
|
toOffsetOutBounds(t, to, offsetBounds) {
|
|
1296
|
-
if (!to) to = t; else copy$
|
|
1296
|
+
if (!to) to = t; else copy$c(to, t);
|
|
1297
1297
|
if (!offsetBounds) offsetBounds = t;
|
|
1298
1298
|
to.offsetX = B.maxX(offsetBounds);
|
|
1299
1299
|
to.offsetY = B.maxY(offsetBounds);
|
|
@@ -1440,7 +1440,7 @@ const BoundsHelper = {
|
|
|
1440
1440
|
if (bounds && (bounds.width || bounds.height)) {
|
|
1441
1441
|
if (first) {
|
|
1442
1442
|
first = false;
|
|
1443
|
-
if (!addMode) copy$
|
|
1443
|
+
if (!addMode) copy$c(t, bounds);
|
|
1444
1444
|
} else {
|
|
1445
1445
|
add$2(t, bounds);
|
|
1446
1446
|
}
|
|
@@ -1533,7 +1533,7 @@ const BoundsHelper = {
|
|
|
1533
1533
|
|
|
1534
1534
|
const B = BoundsHelper;
|
|
1535
1535
|
|
|
1536
|
-
const {add: add$2, copy: copy$
|
|
1536
|
+
const {add: add$2, copy: copy$c} = B;
|
|
1537
1537
|
|
|
1538
1538
|
class Bounds {
|
|
1539
1539
|
get minX() {
|
|
@@ -2306,7 +2306,7 @@ __decorate([ contextMethod() ], Canvas$1.prototype, "measureText", null);
|
|
|
2306
2306
|
|
|
2307
2307
|
__decorate([ contextMethod() ], Canvas$1.prototype, "strokeText", null);
|
|
2308
2308
|
|
|
2309
|
-
const {copy: copy$
|
|
2309
|
+
const {copy: copy$b, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2310
2310
|
|
|
2311
2311
|
const minSize = {
|
|
2312
2312
|
width: 1,
|
|
@@ -2561,7 +2561,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2561
2561
|
getSameCanvas(useSameWorldTransform, useSameSmooth) {
|
|
2562
2562
|
const {size: size, pixelSnap: pixelSnap} = this, canvas = this.manager ? this.manager.get(size) : Creator.canvas(Object.assign({}, size));
|
|
2563
2563
|
canvas.save();
|
|
2564
|
-
if (useSameWorldTransform) copy$
|
|
2564
|
+
if (useSameWorldTransform) copy$b(canvas.worldTransform, this.worldTransform), canvas.useWorldTransform();
|
|
2565
2565
|
if (useSameSmooth) canvas.smooth = this.smooth;
|
|
2566
2566
|
canvas.pixelSnap !== pixelSnap && (canvas.pixelSnap = pixelSnap);
|
|
2567
2567
|
return canvas;
|
|
@@ -3583,7 +3583,7 @@ const {M: M$7, L: L$7, C: C$5, Q: Q$3, Z: Z$5, N: N$2, D: D$3, X: X$2, G: G$2, F
|
|
|
3583
3583
|
|
|
3584
3584
|
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$2, arc: arc, ellipse: ellipse$2} = BezierHelper;
|
|
3585
3585
|
|
|
3586
|
-
const {addPointBounds: addPointBounds, copy: copy$
|
|
3586
|
+
const {addPointBounds: addPointBounds, copy: copy$a, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
3587
3587
|
|
|
3588
3588
|
const debug$d = Debug.get("PathBounds");
|
|
3589
3589
|
|
|
@@ -3665,7 +3665,7 @@ const PathBounds = {
|
|
|
3665
3665
|
|
|
3666
3666
|
case G$2:
|
|
3667
3667
|
ellipse$2(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
|
|
3668
|
-
i === 0 ? copy$
|
|
3668
|
+
i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3669
3669
|
x = setEndPoint.x;
|
|
3670
3670
|
y = setEndPoint.y;
|
|
3671
3671
|
i += 9;
|
|
@@ -3683,7 +3683,7 @@ const PathBounds = {
|
|
|
3683
3683
|
|
|
3684
3684
|
case O$3:
|
|
3685
3685
|
arc(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], tempPointBounds, setEndPoint);
|
|
3686
|
-
i === 0 ? copy$
|
|
3686
|
+
i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3687
3687
|
x = setEndPoint.x;
|
|
3688
3688
|
y = setEndPoint.y;
|
|
3689
3689
|
i += 7;
|
|
@@ -3700,7 +3700,7 @@ const PathBounds = {
|
|
|
3700
3700
|
|
|
3701
3701
|
case U$2:
|
|
3702
3702
|
arcTo$2(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
|
|
3703
|
-
i === 0 ? copy$
|
|
3703
|
+
i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3704
3704
|
x = setEndPoint.x;
|
|
3705
3705
|
y = setEndPoint.y;
|
|
3706
3706
|
i += 6;
|
|
@@ -4586,7 +4586,9 @@ function sortType(defaultValue) {
|
|
|
4586
4586
|
set(value) {
|
|
4587
4587
|
if (this.__setAttr(key, value)) {
|
|
4588
4588
|
this.waitParent(() => {
|
|
4589
|
-
this
|
|
4589
|
+
const {parent: parent} = this;
|
|
4590
|
+
parent.__layout.childrenSortChange();
|
|
4591
|
+
if (parent.__.flow) parent.__layout.boxChange();
|
|
4590
4592
|
});
|
|
4591
4593
|
}
|
|
4592
4594
|
}
|
|
@@ -4779,7 +4781,7 @@ function registerUIEvent() {
|
|
|
4779
4781
|
};
|
|
4780
4782
|
}
|
|
4781
4783
|
|
|
4782
|
-
const {copy: copy$
|
|
4784
|
+
const {copy: copy$9, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$2, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
|
|
4783
4785
|
|
|
4784
4786
|
const matrix$3 = {}, {round: round$3} = Math;
|
|
4785
4787
|
|
|
@@ -4884,7 +4886,7 @@ const LeafHelper = {
|
|
|
4884
4886
|
if (scaleY) transition = scaleY;
|
|
4885
4887
|
scaleY = scaleX;
|
|
4886
4888
|
}
|
|
4887
|
-
copy$
|
|
4889
|
+
copy$9(matrix$3, o);
|
|
4888
4890
|
scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
|
|
4889
4891
|
if (L$5.hasHighPosition(t)) {
|
|
4890
4892
|
L$5.setTransform(t, matrix$3, resize, transition, boundsType);
|
|
@@ -4903,7 +4905,7 @@ const LeafHelper = {
|
|
|
4903
4905
|
},
|
|
4904
4906
|
rotateOfLocal(t, origin, angle, transition) {
|
|
4905
4907
|
const o = t.__localMatrix;
|
|
4906
|
-
copy$
|
|
4908
|
+
copy$9(matrix$3, o);
|
|
4907
4909
|
rotateOfOuter$2(matrix$3, origin, angle);
|
|
4908
4910
|
if (L$5.hasHighPosition(t)) L$5.setTransform(t, matrix$3, false, transition); else t.set({
|
|
4909
4911
|
x: t.x + matrix$3.e - o.e,
|
|
@@ -4915,18 +4917,18 @@ const LeafHelper = {
|
|
|
4915
4917
|
L$5.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4916
4918
|
},
|
|
4917
4919
|
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4918
|
-
copy$
|
|
4920
|
+
copy$9(matrix$3, t.__localMatrix);
|
|
4919
4921
|
skewOfOuter(matrix$3, origin, skewX, skewY);
|
|
4920
4922
|
L$5.setTransform(t, matrix$3, resize, transition);
|
|
4921
4923
|
},
|
|
4922
4924
|
transformWorld(t, transform, resize, transition, boundsType) {
|
|
4923
|
-
copy$
|
|
4925
|
+
copy$9(matrix$3, t.worldTransform);
|
|
4924
4926
|
multiplyParent$3(matrix$3, transform);
|
|
4925
4927
|
if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
|
|
4926
4928
|
L$5.setTransform(t, matrix$3, resize, transition, boundsType);
|
|
4927
4929
|
},
|
|
4928
4930
|
transform(t, transform, resize, transition, boundsType) {
|
|
4929
|
-
copy$
|
|
4931
|
+
copy$9(matrix$3, t.localTransform);
|
|
4930
4932
|
multiplyParent$3(matrix$3, transform);
|
|
4931
4933
|
L$5.setTransform(t, matrix$3, resize, transition, boundsType);
|
|
4932
4934
|
},
|
|
@@ -4964,7 +4966,7 @@ const LeafHelper = {
|
|
|
4964
4966
|
return innerOrigin;
|
|
4965
4967
|
},
|
|
4966
4968
|
getRelativeWorld(t, relative, temp) {
|
|
4967
|
-
copy$
|
|
4969
|
+
copy$9(matrix$3, t.worldTransform);
|
|
4968
4970
|
divideParent(matrix$3, relative.scrollWorldTransform);
|
|
4969
4971
|
return temp ? matrix$3 : Object.assign({}, matrix$3);
|
|
4970
4972
|
},
|
|
@@ -4988,7 +4990,7 @@ const LeafHelper = {
|
|
|
4988
4990
|
p = p.parent;
|
|
4989
4991
|
}
|
|
4990
4992
|
},
|
|
4991
|
-
animateMove(t, move, speed = .3) {
|
|
4993
|
+
animateMove(t, move, speed = .3, onAnimate) {
|
|
4992
4994
|
if (!move.x && !move.y) return;
|
|
4993
4995
|
if (Math.abs(move.x) < 1 && Math.abs(move.y) < 1) {
|
|
4994
4996
|
t.move(move);
|
|
@@ -4996,8 +4998,9 @@ const LeafHelper = {
|
|
|
4996
4998
|
const x = move.x * speed, y = move.y * speed;
|
|
4997
4999
|
move.x -= x, move.y -= y;
|
|
4998
5000
|
t.move(x, y);
|
|
4999
|
-
Platform.requestRender(() => L$5.animateMove(t, move, speed));
|
|
5001
|
+
Platform.requestRender(() => L$5.animateMove(t, move, speed, onAnimate));
|
|
5000
5002
|
}
|
|
5003
|
+
onAnimate && onAnimate();
|
|
5001
5004
|
}
|
|
5002
5005
|
};
|
|
5003
5006
|
|
|
@@ -5177,7 +5180,7 @@ const WaitHelper = {
|
|
|
5177
5180
|
|
|
5178
5181
|
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$3} = LeafHelper;
|
|
5179
5182
|
|
|
5180
|
-
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$
|
|
5183
|
+
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$8} = BoundsHelper;
|
|
5181
5184
|
|
|
5182
5185
|
const localContent = "_localContentBounds";
|
|
5183
5186
|
|
|
@@ -5416,7 +5419,7 @@ class LeafLayout {
|
|
|
5416
5419
|
matrix = getRelativeWorld$1(leaf, relative, true);
|
|
5417
5420
|
}
|
|
5418
5421
|
if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix);
|
|
5419
|
-
copy$
|
|
5422
|
+
copy$8(layoutBounds, bounds);
|
|
5420
5423
|
PointHelper.copy(layoutBounds, point);
|
|
5421
5424
|
if (unscale) {
|
|
5422
5425
|
const {scaleX: scaleX, scaleY: scaleY} = layoutBounds;
|
|
@@ -6071,7 +6074,7 @@ const {updateMatrix: updateMatrix$3, updateAllMatrix: updateAllMatrix$3} = LeafH
|
|
|
6071
6074
|
|
|
6072
6075
|
const {updateBounds: updateBounds$2} = BranchHelper;
|
|
6073
6076
|
|
|
6074
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$
|
|
6077
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$7} = BoundsHelper;
|
|
6075
6078
|
|
|
6076
6079
|
const {toBounds: toBounds$1} = PathBounds;
|
|
6077
6080
|
|
|
@@ -6169,6 +6172,7 @@ const LeafBounds = {
|
|
|
6169
6172
|
if (this.isBranch) {
|
|
6170
6173
|
this.__extraUpdate();
|
|
6171
6174
|
if (this.__.flow) {
|
|
6175
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6172
6176
|
if (this.__layout.boxChanged) this.__updateFlowLayout();
|
|
6173
6177
|
updateAllMatrix$3(this);
|
|
6174
6178
|
updateBounds$2(this, this);
|
|
@@ -6192,7 +6196,7 @@ const LeafBounds = {
|
|
|
6192
6196
|
},
|
|
6193
6197
|
__updateRenderBounds(_bounds) {
|
|
6194
6198
|
const layout = this.__layout, {renderSpread: renderSpread} = layout;
|
|
6195
|
-
isNumber(renderSpread) && renderSpread <= 0 ? copy$
|
|
6199
|
+
isNumber(renderSpread) && renderSpread <= 0 ? copy$7(layout.renderBounds, layout.strokeBounds) : copyAndSpread$4(layout.renderBounds, layout.boxBounds, renderSpread);
|
|
6196
6200
|
}
|
|
6197
6201
|
};
|
|
6198
6202
|
|
|
@@ -6240,11 +6244,7 @@ const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper, {hasSize:
|
|
|
6240
6244
|
|
|
6241
6245
|
const BranchRender = {
|
|
6242
6246
|
__updateChange() {
|
|
6243
|
-
|
|
6244
|
-
if (layout.childrenSortChanged) {
|
|
6245
|
-
this.__updateSortChildren();
|
|
6246
|
-
layout.childrenSortChanged = false;
|
|
6247
|
-
}
|
|
6247
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6248
6248
|
this.__.__checkSingle();
|
|
6249
6249
|
},
|
|
6250
6250
|
__render(canvas, options) {
|
|
@@ -6296,7 +6296,7 @@ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint$1, multiplyParent:
|
|
|
6296
6296
|
|
|
6297
6297
|
const {toOuterOf: toOuterOf$1} = BoundsHelper;
|
|
6298
6298
|
|
|
6299
|
-
const {copy: copy$
|
|
6299
|
+
const {copy: copy$6, move: move$8} = PointHelper;
|
|
6300
6300
|
|
|
6301
6301
|
const {getScaleFixedData: getScaleFixedData$1} = MathHelper;
|
|
6302
6302
|
|
|
@@ -6560,14 +6560,14 @@ let Leaf = class Leaf {
|
|
|
6560
6560
|
if (this.parent) {
|
|
6561
6561
|
this.parent.worldToInner(world, to, distance, relative);
|
|
6562
6562
|
} else {
|
|
6563
|
-
if (to) copy$
|
|
6563
|
+
if (to) copy$6(to, world);
|
|
6564
6564
|
}
|
|
6565
6565
|
}
|
|
6566
6566
|
localToWorld(local, to, distance, relative) {
|
|
6567
6567
|
if (this.parent) {
|
|
6568
6568
|
this.parent.innerToWorld(local, to, distance, relative);
|
|
6569
6569
|
} else {
|
|
6570
|
-
if (to) copy$
|
|
6570
|
+
if (to) copy$6(to, local);
|
|
6571
6571
|
}
|
|
6572
6572
|
}
|
|
6573
6573
|
worldToInner(world, to, distance, relative) {
|
|
@@ -6748,6 +6748,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6748
6748
|
children.sort(sort);
|
|
6749
6749
|
this.__layout.affectChildrenSort = affectSort;
|
|
6750
6750
|
}
|
|
6751
|
+
this.__layout.childrenSortChanged = false;
|
|
6751
6752
|
}
|
|
6752
6753
|
add(child, index) {
|
|
6753
6754
|
if (child === this || child.destroyed) return debug$8.warn("add self or destroyed");
|
|
@@ -6983,7 +6984,7 @@ class LeafLevelList {
|
|
|
6983
6984
|
}
|
|
6984
6985
|
}
|
|
6985
6986
|
|
|
6986
|
-
const version = "2.1.
|
|
6987
|
+
const version = "2.1.9";
|
|
6987
6988
|
|
|
6988
6989
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6989
6990
|
get allowBackgroundColor() {
|
|
@@ -7299,7 +7300,10 @@ class Watcher {
|
|
|
7299
7300
|
if (this.running) this.target.emit(RenderEvent.REQUEST);
|
|
7300
7301
|
}
|
|
7301
7302
|
__onAttrChange(event) {
|
|
7302
|
-
|
|
7303
|
+
this.add(event.target);
|
|
7304
|
+
}
|
|
7305
|
+
add(leaf) {
|
|
7306
|
+
if (this.config.usePartLayout) this.__updatedList.add(leaf);
|
|
7303
7307
|
this.update();
|
|
7304
7308
|
}
|
|
7305
7309
|
__onChildEvent(event) {
|
|
@@ -8338,11 +8342,7 @@ class PolygonData extends UIData {
|
|
|
8338
8342
|
}
|
|
8339
8343
|
}
|
|
8340
8344
|
|
|
8341
|
-
class StarData extends UIData {
|
|
8342
|
-
get __boxStroke() {
|
|
8343
|
-
return !this.__pathInputed;
|
|
8344
|
-
}
|
|
8345
|
-
}
|
|
8345
|
+
class StarData extends UIData {}
|
|
8346
8346
|
|
|
8347
8347
|
class PathData extends UIData {
|
|
8348
8348
|
get __pathInputed() {
|
|
@@ -9513,7 +9513,10 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9513
9513
|
ellipse$1(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
9514
9514
|
} else {
|
|
9515
9515
|
if (hasAngle) {
|
|
9516
|
-
if (!closedAngle)
|
|
9516
|
+
if (!closedAngle) {
|
|
9517
|
+
if (!closed) open = true;
|
|
9518
|
+
if (!open) moveTo$3(path, rx, ry);
|
|
9519
|
+
}
|
|
9517
9520
|
ellipse$1(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
9518
9521
|
} else {
|
|
9519
9522
|
ellipse$1(path, rx, ry, rx, ry);
|
|
@@ -10191,8 +10194,8 @@ const DragBoundsHelper = {
|
|
|
10191
10194
|
if (!change) scale = Object.assign({}, scale);
|
|
10192
10195
|
tempDragBounds.set(dragBounds);
|
|
10193
10196
|
tempContent.set(content).scaleOf(origin, scale.x, scale.y);
|
|
10194
|
-
const originLeftScale = (origin.x - content.x) / content.width, originRightScale = 1 - originLeftScale;
|
|
10195
|
-
const originTopScale = (origin.y - content.y) / content.height, originBottomScale = 1 - originTopScale;
|
|
10197
|
+
const originLeftScale = float$3((origin.x - content.x) / content.width), originRightScale = float$3(1 - originLeftScale);
|
|
10198
|
+
const originTopScale = float$3((origin.y - content.y) / content.height), originBottomScale = float$3(1 - originTopScale);
|
|
10196
10199
|
let correctScaleX = 1, correctScaleY = 1, aScale, bScale, aSize, bSize;
|
|
10197
10200
|
if (D$2.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
10198
10201
|
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
@@ -10203,7 +10206,13 @@ const DragBoundsHelper = {
|
|
|
10203
10206
|
correctScaleX *= max$3(aScale, bScale);
|
|
10204
10207
|
} else {
|
|
10205
10208
|
if (scale.x < 0) {
|
|
10206
|
-
if (float$3(minX(content) - minX(dragBounds)) <= 0 || float$3(maxX(dragBounds) - maxX(content)) <= 0)
|
|
10209
|
+
if (float$3(minX(content) - minX(dragBounds), 2) <= 0 || float$3(maxX(dragBounds) - maxX(content), 2) <= 0) {
|
|
10210
|
+
tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
10211
|
+
if (tempContent.width > 1) {
|
|
10212
|
+
correctScaleX *= 1 / tempContent.width;
|
|
10213
|
+
tempContent.width = 1;
|
|
10214
|
+
}
|
|
10215
|
+
}
|
|
10207
10216
|
tempContent.unsign();
|
|
10208
10217
|
}
|
|
10209
10218
|
aSize = float$3(tempDragBounds.minX - tempContent.minX);
|
|
@@ -10226,7 +10235,13 @@ const DragBoundsHelper = {
|
|
|
10226
10235
|
}
|
|
10227
10236
|
} else {
|
|
10228
10237
|
if (scale.y < 0) {
|
|
10229
|
-
if (float$3(minY(content) - minY(dragBounds)) <= 0 || float$3(maxY(dragBounds) - maxY(content)) <= 0)
|
|
10238
|
+
if (float$3(minY(content) - minY(dragBounds), 2) <= 0 || float$3(maxY(dragBounds) - maxY(content), 2) <= 0) {
|
|
10239
|
+
tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10240
|
+
if (tempContent.height > 1) {
|
|
10241
|
+
correctScaleY *= 1 / tempContent.height;
|
|
10242
|
+
tempContent.height = 1;
|
|
10243
|
+
}
|
|
10244
|
+
}
|
|
10230
10245
|
tempContent.unsign();
|
|
10231
10246
|
}
|
|
10232
10247
|
aSize = float$3(tempDragBounds.minY - tempContent.minY);
|
|
@@ -10357,6 +10372,8 @@ DragEvent.ENTER = "drag.enter";
|
|
|
10357
10372
|
|
|
10358
10373
|
DragEvent.LEAVE = "drag.leave";
|
|
10359
10374
|
|
|
10375
|
+
DragEvent.ANIMATE = "drag.animate";
|
|
10376
|
+
|
|
10360
10377
|
DragEvent = __decorate([ registerUIEvent() ], DragEvent);
|
|
10361
10378
|
|
|
10362
10379
|
const MyDragEvent = DragEvent;
|
|
@@ -10611,7 +10628,7 @@ class Dragger {
|
|
|
10611
10628
|
x: totalX,
|
|
10612
10629
|
y: totalY
|
|
10613
10630
|
}, checkLimitMove || axisDrag);
|
|
10614
|
-
if (dragLimitAnimate && !axisDrag && isDragEnd) LeafHelper.animateMove(leaf, move, isNumber(dragLimitAnimate) ? dragLimitAnimate : .3); else leaf.move(move);
|
|
10631
|
+
if (dragLimitAnimate && !axisDrag && isDragEnd) LeafHelper.animateMove(leaf, move, isNumber(dragLimitAnimate) ? dragLimitAnimate : .3, () => leaf.emit(DragEvent.ANIMATE)); else leaf.move(move);
|
|
10615
10632
|
}
|
|
10616
10633
|
});
|
|
10617
10634
|
}
|
|
@@ -12156,7 +12173,7 @@ function getGapValue(gap, size, totalSize, rows) {
|
|
|
12156
12173
|
return gap === "auto" ? value < 0 ? 0 : value : value;
|
|
12157
12174
|
}
|
|
12158
12175
|
|
|
12159
|
-
let origin$1 = {}, tempMatrix$
|
|
12176
|
+
let origin$1 = {}, tempMatrix$2 = getMatrixData();
|
|
12160
12177
|
|
|
12161
12178
|
const {get: get$2, set: set, rotateOfOuter: rotateOfOuter$1, translate: translate, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate$2, skew: skewHelper} = MatrixHelper;
|
|
12162
12179
|
|
|
@@ -12183,9 +12200,9 @@ function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew, clipScaleX, c
|
|
|
12183
12200
|
layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew);
|
|
12184
12201
|
if (clipScaleX) {
|
|
12185
12202
|
if (rotation || skew) {
|
|
12186
|
-
set(tempMatrix$
|
|
12187
|
-
scaleOfOuter$1(tempMatrix$
|
|
12188
|
-
multiplyParent(transform, tempMatrix$
|
|
12203
|
+
set(tempMatrix$2);
|
|
12204
|
+
scaleOfOuter$1(tempMatrix$2, box, clipScaleX, clipScaleY);
|
|
12205
|
+
multiplyParent(transform, tempMatrix$2);
|
|
12189
12206
|
} else scaleOfOuter$1(transform, box, clipScaleX, clipScaleY);
|
|
12190
12207
|
}
|
|
12191
12208
|
data.transform = transform;
|
|
@@ -12234,7 +12251,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
|
|
|
12234
12251
|
translate(transform, box.x + x, box.y + y);
|
|
12235
12252
|
}
|
|
12236
12253
|
|
|
12237
|
-
const {get: get$1, scale: scale$3, copy: copy$
|
|
12254
|
+
const {get: get$1, scale: scale$3, copy: copy$5} = MatrixHelper;
|
|
12238
12255
|
|
|
12239
12256
|
const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
|
|
12240
12257
|
|
|
@@ -12260,19 +12277,15 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
12260
12277
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
12261
12278
|
width *= scaleX;
|
|
12262
12279
|
height *= scaleY;
|
|
12263
|
-
if (gap) {
|
|
12280
|
+
if (gap && !brush) {
|
|
12264
12281
|
xGap = gap.x * scaleX / abs$7(data.scaleX || 1);
|
|
12265
12282
|
yGap = gap.y * scaleY / abs$7(data.scaleY || 1);
|
|
12266
|
-
if (brush) {
|
|
12267
|
-
const brushScale = PaintImage.getBrushScale(paint, ui);
|
|
12268
|
-
xGap /= brushScale, yGap /= brushScale;
|
|
12269
|
-
}
|
|
12270
12283
|
}
|
|
12271
12284
|
if (transform || scaleX !== 1 || scaleY !== 1) {
|
|
12272
12285
|
scaleX *= getFloorScale(width + (xGap || 0));
|
|
12273
12286
|
scaleY *= getFloorScale(height + (yGap || 0));
|
|
12274
12287
|
imageMatrix = get$1();
|
|
12275
|
-
if (transform) copy$
|
|
12288
|
+
if (transform) copy$5(imageMatrix, transform);
|
|
12276
12289
|
scale$3(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
12277
12290
|
}
|
|
12278
12291
|
const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
|
|
@@ -12510,9 +12523,9 @@ const PaintGradientModule = {
|
|
|
12510
12523
|
getTransform: getTransform
|
|
12511
12524
|
};
|
|
12512
12525
|
|
|
12513
|
-
const {copy: copy$
|
|
12526
|
+
const {copy: copy$4, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$6} = Math;
|
|
12514
12527
|
|
|
12515
|
-
const tempBounds$1 = {}, tempMatrix = new Matrix;
|
|
12528
|
+
const tempBounds$1 = {}, tempMatrix$1 = new Matrix;
|
|
12516
12529
|
|
|
12517
12530
|
const offsetOutBounds$1 = {};
|
|
12518
12531
|
|
|
@@ -12566,11 +12579,11 @@ function getShadowRenderSpread(_ui, shadow) {
|
|
|
12566
12579
|
function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
|
|
12567
12580
|
if (shadow.spread) {
|
|
12568
12581
|
const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), {width: width, height: height} = ui.__layout.strokeBounds;
|
|
12569
|
-
tempMatrix.set().scaleOfOuter({
|
|
12582
|
+
tempMatrix$1.set().scaleOfOuter({
|
|
12570
12583
|
x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
|
|
12571
12584
|
y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
|
|
12572
12585
|
}, 1 + spread / width, 1 + spread / height);
|
|
12573
|
-
return tempMatrix;
|
|
12586
|
+
return tempMatrix$1;
|
|
12574
12587
|
}
|
|
12575
12588
|
return undefined;
|
|
12576
12589
|
}
|
|
@@ -12579,7 +12592,7 @@ function drawWorldShadow(canvas, outBounds, shape) {
|
|
|
12579
12592
|
const {shapeBounds: shapeBounds} = shape;
|
|
12580
12593
|
let from, to;
|
|
12581
12594
|
if (Platform.fullImageShadow) {
|
|
12582
|
-
copy$
|
|
12595
|
+
copy$4(tempBounds$1, canvas.bounds);
|
|
12583
12596
|
move$6(tempBounds$1, outBounds.x - shapeBounds.x, outBounds.y - shapeBounds.y);
|
|
12584
12597
|
from = canvas.bounds, to = tempBounds$1;
|
|
12585
12598
|
} else {
|
|
@@ -13398,7 +13411,7 @@ function mergeConfigAttr() {
|
|
|
13398
13411
|
|
|
13399
13412
|
const {abs: abs$5} = Math;
|
|
13400
13413
|
|
|
13401
|
-
const {copy: copy$
|
|
13414
|
+
const {copy: copy$3} = MatrixHelper;
|
|
13402
13415
|
|
|
13403
13416
|
const {setListWithFn: setListWithFn} = BoundsHelper;
|
|
13404
13417
|
|
|
@@ -13440,7 +13453,7 @@ class Stroker extends UI {
|
|
|
13440
13453
|
const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
|
|
13441
13454
|
if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
|
|
13442
13455
|
const aScaleX = abs$5(worldTransform.scaleX), aScaleY = abs$5(worldTransform.scaleY);
|
|
13443
|
-
copy$
|
|
13456
|
+
copy$3(matrix$1, worldTransform);
|
|
13444
13457
|
matrix$1.half = strokeWidth % 2;
|
|
13445
13458
|
canvas.setWorld(matrix$1, options.matrix);
|
|
13446
13459
|
canvas.beginPath();
|
|
@@ -13772,7 +13785,7 @@ const EditDataHelper = {
|
|
|
13772
13785
|
getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode, boundsType) {
|
|
13773
13786
|
let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
|
|
13774
13787
|
const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
|
|
13775
|
-
const {width: width, height: height} = startBounds;
|
|
13788
|
+
const {width: width, height: height} = startBounds, worldScaleX = abs$4(worldTransform.scaleX), worldScaleY = abs$4(worldTransform.scaleY);
|
|
13776
13789
|
const innerBounds = target.getBounds(boundsType, "inner");
|
|
13777
13790
|
const originChangedScaleX = target.scaleX / startBounds.scaleX;
|
|
13778
13791
|
const originChangedScaleY = target.scaleY / startBounds.scaleY;
|
|
@@ -13864,9 +13877,8 @@ const EditDataHelper = {
|
|
|
13864
13877
|
if (useScaleX) scaleX /= changedScaleX;
|
|
13865
13878
|
if (useScaleY) scaleY /= changedScaleY;
|
|
13866
13879
|
if (!flipable) {
|
|
13867
|
-
|
|
13868
|
-
if (
|
|
13869
|
-
if (scaleY < 0) scaleY = 1 / innerBounds.height / worldTransform.scaleY;
|
|
13880
|
+
if (scaleX < 0) scaleX = 1 / innerBounds.width / worldScaleX;
|
|
13881
|
+
if (scaleY < 0) scaleY = 1 / innerBounds.height / worldScaleY;
|
|
13870
13882
|
}
|
|
13871
13883
|
toPoint(around || align, innerBounds, origin, true);
|
|
13872
13884
|
this.checkOrigin(target, origin, boundsType);
|
|
@@ -13887,13 +13899,14 @@ const EditDataHelper = {
|
|
|
13887
13899
|
const nowHeight = innerBounds.height * target.scaleY;
|
|
13888
13900
|
scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
|
|
13889
13901
|
}
|
|
13890
|
-
let minWidth = 1
|
|
13902
|
+
let minWidth = 1, minHeight = 1;
|
|
13891
13903
|
if (boundsType !== "box") {
|
|
13892
|
-
minWidth += innerBounds.width - boxBounds.width;
|
|
13893
|
-
minHeight += innerBounds.height - boxBounds.height;
|
|
13904
|
+
minWidth += (innerBounds.width - boxBounds.width) * worldScaleX;
|
|
13905
|
+
minHeight += (innerBounds.height - boxBounds.height) * worldScaleY;
|
|
13894
13906
|
}
|
|
13895
|
-
|
|
13896
|
-
if (
|
|
13907
|
+
const worldWidth = worldScaleX * innerBounds.width, worldHeight = worldScaleY * innerBounds.height;
|
|
13908
|
+
if (useScaleX && abs$4(scaleX * worldWidth) < minWidth) scaleX = sign$1(scaleX) * minWidth / worldWidth;
|
|
13909
|
+
if (useScaleY && abs$4(scaleY * worldHeight) < minHeight) scaleY = sign$1(scaleY) * minHeight / worldHeight;
|
|
13897
13910
|
if (lockRatio && scaleX !== scaleY) {
|
|
13898
13911
|
lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
|
|
13899
13912
|
scaleX = sign$1(scaleX) * lockScale;
|
|
@@ -14276,8 +14289,8 @@ class EditBox extends Group {
|
|
|
14276
14289
|
updateMoveCursor(this);
|
|
14277
14290
|
}
|
|
14278
14291
|
update() {
|
|
14279
|
-
const {editor: editor
|
|
14280
|
-
const {x: x, y: y, scaleX: scaleX, scaleY: scaleY, rotation: rotation, skewX: skewX, skewY: skewY, width: width, height: height} = this.target.getLayoutBounds(
|
|
14292
|
+
const {editor: editor} = this;
|
|
14293
|
+
const {x: x, y: y, scaleX: scaleX, scaleY: scaleY, rotation: rotation, skewX: skewX, skewY: skewY, width: width, height: height} = this.target.getLayoutBounds("box", editor, true);
|
|
14281
14294
|
this.visible = !this.target.locked;
|
|
14282
14295
|
this.set({
|
|
14283
14296
|
x: x,
|
|
@@ -14300,9 +14313,9 @@ class EditBox extends Group {
|
|
|
14300
14313
|
if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
|
|
14301
14314
|
}
|
|
14302
14315
|
updateBounds(bounds) {
|
|
14303
|
-
const {editor: editor,
|
|
14316
|
+
const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
|
|
14304
14317
|
const {editMask: editMask} = editor;
|
|
14305
|
-
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} =
|
|
14318
|
+
const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, editBoxType: editBoxType, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
|
|
14306
14319
|
editMask.visible = mask ? true : 0;
|
|
14307
14320
|
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
14308
14321
|
editor.setDimOthers(dimOthers);
|
|
@@ -14311,6 +14324,7 @@ class EditBox extends Group {
|
|
|
14311
14324
|
} else if (editor.hasDimOthers) {
|
|
14312
14325
|
editor.cancelDimOthers();
|
|
14313
14326
|
}
|
|
14327
|
+
if (editBoxType === "stroke") BoundsHelper.spread(bounds, editor.element.__layout.strokeBoxSpread);
|
|
14314
14328
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14315
14329
|
if (this.view.worldOpacity) {
|
|
14316
14330
|
const {width: width, height: height} = bounds;
|
|
@@ -14340,7 +14354,7 @@ class EditBox extends Group {
|
|
|
14340
14354
|
}
|
|
14341
14355
|
}
|
|
14342
14356
|
}
|
|
14343
|
-
circle.visible = showPoints && rotateable && !!(
|
|
14357
|
+
circle.visible = showPoints && rotateable && !!(mergeConfig.circle || mergeConfig.rotatePoint);
|
|
14344
14358
|
if (circle.visible) this.layoutCircle();
|
|
14345
14359
|
if (rect.path) rect.path = null;
|
|
14346
14360
|
rect.set(Object.assign(Object.assign({}, bounds), {
|
|
@@ -14833,10 +14847,11 @@ const registerInnerEditor = registerEditTool;
|
|
|
14833
14847
|
|
|
14834
14848
|
const EditToolCreator = {
|
|
14835
14849
|
list: {},
|
|
14836
|
-
register(EditTool) {
|
|
14850
|
+
register(EditTool, name) {
|
|
14837
14851
|
const {tag: tag} = EditTool.prototype;
|
|
14838
|
-
|
|
14839
|
-
list$1[
|
|
14852
|
+
name || (name = tag);
|
|
14853
|
+
list$1[name] && debug$2.repeat(name);
|
|
14854
|
+
list$1[name] = EditTool;
|
|
14840
14855
|
},
|
|
14841
14856
|
get(tag, editor) {
|
|
14842
14857
|
return new list$1[tag](editor);
|
|
@@ -15390,17 +15405,21 @@ let Editor = class Editor extends Group {
|
|
|
15390
15405
|
if (EditToolCreator.list[name]) {
|
|
15391
15406
|
const tool = this.editTool = this.getEditTool(name);
|
|
15392
15407
|
this.editBox.load();
|
|
15408
|
+
tool.editTarget = target;
|
|
15393
15409
|
tool.load();
|
|
15394
15410
|
this.update();
|
|
15395
15411
|
}
|
|
15396
15412
|
}
|
|
15397
15413
|
}
|
|
15398
|
-
unloadEditTool() {
|
|
15414
|
+
unloadEditTool(onlyTool) {
|
|
15399
15415
|
let tool = this.editTool;
|
|
15400
15416
|
if (tool) {
|
|
15401
|
-
|
|
15417
|
+
if (!onlyTool) {
|
|
15418
|
+
this.editBox.unload();
|
|
15419
|
+
this.editTool = null;
|
|
15420
|
+
}
|
|
15402
15421
|
tool.unload();
|
|
15403
|
-
|
|
15422
|
+
tool.editTarget = null;
|
|
15404
15423
|
}
|
|
15405
15424
|
}
|
|
15406
15425
|
getEditSize(_ui) {
|
|
@@ -15499,7 +15518,7 @@ let Editor = class Editor extends Group {
|
|
|
15499
15518
|
if (isString(check)) name = check; else if (check === false) return;
|
|
15500
15519
|
}
|
|
15501
15520
|
if (EditToolCreator.list[name]) {
|
|
15502
|
-
this.
|
|
15521
|
+
this.unloadEditTool(true);
|
|
15503
15522
|
this.innerEditing = true;
|
|
15504
15523
|
this.innerEditor = this.getInnerEditor(name);
|
|
15505
15524
|
this.innerEditor.editTarget = target;
|
|
@@ -15516,7 +15535,7 @@ let Editor = class Editor extends Group {
|
|
|
15516
15535
|
this.innerEditor.unload();
|
|
15517
15536
|
this.emitInnerEvent(InnerEditorEvent.CLOSE);
|
|
15518
15537
|
if (!onlyInnerEditor) this.updateEditTool();
|
|
15519
|
-
this.innerEditor = null;
|
|
15538
|
+
this.innerEditor = this.innerEditor.editTarget = null;
|
|
15520
15539
|
}
|
|
15521
15540
|
}
|
|
15522
15541
|
emitInnerEvent(type) {
|
|
@@ -15651,8 +15670,13 @@ class InnerEditor {
|
|
|
15651
15670
|
}
|
|
15652
15671
|
|
|
15653
15672
|
let EditTool = class EditTool extends InnerEditor {
|
|
15654
|
-
static registerEditTool() {
|
|
15655
|
-
EditToolCreator.register(this);
|
|
15673
|
+
static registerEditTool(name, changeTag) {
|
|
15674
|
+
EditToolCreator.register(this, name);
|
|
15675
|
+
if (changeTag) defineKey(this.prototype, "tag", {
|
|
15676
|
+
get() {
|
|
15677
|
+
return name;
|
|
15678
|
+
}
|
|
15679
|
+
});
|
|
15656
15680
|
}
|
|
15657
15681
|
get tag() {
|
|
15658
15682
|
return "EditTool";
|
|
@@ -15714,7 +15738,7 @@ EditTool = __decorate([ registerEditTool() ], EditTool);
|
|
|
15714
15738
|
|
|
15715
15739
|
const {left: left$1, right: right$1} = Direction9;
|
|
15716
15740
|
|
|
15717
|
-
const {move: move$5, copy: copy$
|
|
15741
|
+
const {move: move$5, copy: copy$2, toNumberPoints: toNumberPoints} = PointHelper;
|
|
15718
15742
|
|
|
15719
15743
|
let LineEditTool = class LineEditTool extends EditTool {
|
|
15720
15744
|
constructor() {
|
|
@@ -15806,10 +15830,10 @@ let LineEditTool = class LineEditTool extends EditTool {
|
|
|
15806
15830
|
line.innerToWorld(from, from, false, editBox);
|
|
15807
15831
|
line.innerToWorld(to, to, false, editBox);
|
|
15808
15832
|
rect.pen.clearPath().moveTo(from.x, from.y).lineTo(to.x, to.y);
|
|
15809
|
-
copy$
|
|
15810
|
-
copy$
|
|
15811
|
-
copy$
|
|
15812
|
-
copy$
|
|
15833
|
+
copy$2(resizePoints[7], from);
|
|
15834
|
+
copy$2(rotatePoints[7], from);
|
|
15835
|
+
copy$2(resizePoints[3], to);
|
|
15836
|
+
copy$2(rotatePoints[3], to);
|
|
15813
15837
|
}
|
|
15814
15838
|
for (let i = 0; i < 8; i++) {
|
|
15815
15839
|
if (i < 4) resizeLines[i].visible = false;
|
|
@@ -15989,7 +16013,7 @@ function scaleResizeGroup(group, scaleX, scaleY) {
|
|
|
15989
16013
|
}
|
|
15990
16014
|
}
|
|
15991
16015
|
|
|
15992
|
-
const leaf = Leaf.prototype, tempPoint$1 = {}, {scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
|
|
16016
|
+
const leaf = Leaf.prototype, tempPoint$1 = {}, tempMatrix = {}, {copy: copy$1, scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
|
|
15993
16017
|
|
|
15994
16018
|
leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
|
|
15995
16019
|
const data = this;
|
|
@@ -15997,14 +16021,16 @@ leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
|
|
|
15997
16021
|
data.scaleX *= scaleX;
|
|
15998
16022
|
data.scaleY *= scaleY;
|
|
15999
16023
|
} else {
|
|
16000
|
-
|
|
16001
|
-
if (
|
|
16002
|
-
if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY, scale$2(local, 1, -1);
|
|
16024
|
+
if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX;
|
|
16025
|
+
if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY;
|
|
16003
16026
|
if (boundsType === "stroke") {
|
|
16027
|
+
copy$1(tempMatrix, this.__localMatrix);
|
|
16028
|
+
if (scaleX < 0) scale$2(tempMatrix, -1, 1);
|
|
16029
|
+
if (scaleY < 0) scale$2(tempMatrix, 1, -1);
|
|
16004
16030
|
const {boxBounds: boxBounds, strokeBounds: strokeBounds} = this.__layout, {x: x, y: y, width: width, height: height} = strokeBounds;
|
|
16005
16031
|
tempPoint$1.x = (x - boxBounds.x) * (scaleX - 1);
|
|
16006
16032
|
tempPoint$1.y = (y - boxBounds.y) * (scaleY - 1);
|
|
16007
|
-
toOuterPoint(
|
|
16033
|
+
toOuterPoint(tempMatrix, tempPoint$1, tempPoint$1, true);
|
|
16008
16034
|
this.x += tempPoint$1.x;
|
|
16009
16035
|
this.y += tempPoint$1.y;
|
|
16010
16036
|
scaleX = (width * scaleX - (width - boxBounds.width)) / boxBounds.width;
|
|
@@ -16018,14 +16044,14 @@ leaf.__scaleResize = function(scaleX, scaleY) {
|
|
|
16018
16044
|
scaleResize(this, scaleX, scaleY);
|
|
16019
16045
|
};
|
|
16020
16046
|
|
|
16021
|
-
leaf.resizeWidth = function(width) {
|
|
16022
|
-
const scale = width / this.getBounds("box",
|
|
16023
|
-
this.scaleOf(
|
|
16047
|
+
leaf.resizeWidth = function(width, relative = "inner") {
|
|
16048
|
+
const scale = width / this.getBounds("box", relative).width || 1;
|
|
16049
|
+
this.scaleOf("top-left", scale, this.__.lockRatio ? scale : 1, true);
|
|
16024
16050
|
};
|
|
16025
16051
|
|
|
16026
|
-
leaf.resizeHeight = function(height) {
|
|
16027
|
-
const scale = height / this.getBounds("box",
|
|
16028
|
-
this.scaleOf(
|
|
16052
|
+
leaf.resizeHeight = function(height, relative = "inner") {
|
|
16053
|
+
const scale = height / this.getBounds("box", relative).height || 1;
|
|
16054
|
+
this.scaleOf("top-left", this.__.lockRatio ? scale : 1, scale, true);
|
|
16029
16055
|
};
|
|
16030
16056
|
|
|
16031
16057
|
Text.prototype.__scaleResize = function(scaleX, scaleY) {
|
|
@@ -21046,4 +21072,4 @@ function isSame(a, b) {
|
|
|
21046
21072
|
|
|
21047
21073
|
Plugin.add("corner");
|
|
21048
21074
|
|
|
21049
|
-
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$
|
|
21075
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$3 as tempMatrix, tempPoint$6 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|