@leafer/miniapp 2.1.10 → 2.1.11
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 +59 -63
- 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
|
@@ -1256,7 +1256,6 @@ const BoundsHelper = {
|
|
|
1256
1256
|
},
|
|
1257
1257
|
copyAndSpread(t, bounds, spread, isShrink, side) {
|
|
1258
1258
|
const {x: x, y: y, width: width, height: height} = bounds;
|
|
1259
|
-
if (!spread) spread = 0;
|
|
1260
1259
|
if (isArray(spread)) {
|
|
1261
1260
|
const four = fourNumber$1(spread);
|
|
1262
1261
|
isShrink ? B.set(t, x + four[3], y + four[0], width - four[1] - four[3], height - four[2] - four[0]) : B.set(t, x - four[3], y - four[0], width + four[1] + four[3], height + four[2] + four[0]);
|
|
@@ -3577,7 +3576,8 @@ const PathDrawer = {
|
|
|
3577
3576
|
return;
|
|
3578
3577
|
}
|
|
3579
3578
|
}
|
|
3580
|
-
}
|
|
3579
|
+
},
|
|
3580
|
+
drawPathByPoints(_drawer, _points, _closed) {}
|
|
3581
3581
|
};
|
|
3582
3582
|
|
|
3583
3583
|
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: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
|
|
@@ -6985,7 +6985,7 @@ class LeafLevelList {
|
|
|
6985
6985
|
}
|
|
6986
6986
|
}
|
|
6987
6987
|
|
|
6988
|
-
const version = "2.1.
|
|
6988
|
+
const version = "2.1.11";
|
|
6989
6989
|
|
|
6990
6990
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6991
6991
|
get allowBackgroundColor() {
|
|
@@ -8688,8 +8688,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8688
8688
|
this.__drawPathByData(canvas, data.__pathForRender);
|
|
8689
8689
|
}
|
|
8690
8690
|
__drawPath(canvas) {
|
|
8691
|
+
const data = this.__;
|
|
8691
8692
|
canvas.beginPath();
|
|
8692
|
-
this.__drawPathByData(canvas,
|
|
8693
|
+
data.__usePointsMode ? PathDrawer.drawPathByPoints(canvas, data.points, data.closed) : this.__drawPathByData(canvas, data.path, true);
|
|
8693
8694
|
}
|
|
8694
8695
|
__drawPathByData(drawer, data, ignoreCornerRadius) {
|
|
8695
8696
|
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
|
|
@@ -9546,6 +9547,9 @@ let Polygon = class Polygon extends UI {
|
|
|
9546
9547
|
get __tag() {
|
|
9547
9548
|
return "Polygon";
|
|
9548
9549
|
}
|
|
9550
|
+
get isPointsMode() {
|
|
9551
|
+
return this.points && !this.pathInputed;
|
|
9552
|
+
}
|
|
9549
9553
|
__updatePath() {
|
|
9550
9554
|
const data = this.__;
|
|
9551
9555
|
const path = data.path = [];
|
|
@@ -9623,6 +9627,9 @@ let Line = class Line extends UI {
|
|
|
9623
9627
|
get __tag() {
|
|
9624
9628
|
return "Line";
|
|
9625
9629
|
}
|
|
9630
|
+
get isPointsMode() {
|
|
9631
|
+
return this.points && !this.pathInputed;
|
|
9632
|
+
}
|
|
9626
9633
|
get toPoint() {
|
|
9627
9634
|
const {width: width, rotation: rotation} = this.__;
|
|
9628
9635
|
const to = getPointData();
|
|
@@ -13783,17 +13790,16 @@ const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bot
|
|
|
13783
13790
|
const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
|
|
13784
13791
|
|
|
13785
13792
|
const EditDataHelper = {
|
|
13786
|
-
getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode
|
|
13793
|
+
getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
|
|
13787
13794
|
let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
|
|
13788
13795
|
const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
|
|
13789
13796
|
const {width: width, height: height} = startBounds, worldScaleX = abs$4(worldTransform.scaleX), worldScaleY = abs$4(worldTransform.scaleY);
|
|
13790
|
-
const innerBounds = target.getBounds(boundsType, "inner");
|
|
13791
13797
|
const originChangedScaleX = target.scaleX / startBounds.scaleX;
|
|
13792
13798
|
const originChangedScaleY = target.scaleY / startBounds.scaleY;
|
|
13793
13799
|
const signX = sign$1(originChangedScaleX);
|
|
13794
13800
|
const signY = sign$1(originChangedScaleY);
|
|
13795
|
-
const changedScaleX = scaleMode ? originChangedScaleX : signX *
|
|
13796
|
-
const changedScaleY = scaleMode ? originChangedScaleY : signY *
|
|
13801
|
+
const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
|
|
13802
|
+
const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
|
|
13797
13803
|
if (isNumber(totalMoveOrScale)) {
|
|
13798
13804
|
scaleX = scaleY = Math.sqrt(totalMoveOrScale);
|
|
13799
13805
|
} else {
|
|
@@ -13878,11 +13884,10 @@ const EditDataHelper = {
|
|
|
13878
13884
|
if (useScaleX) scaleX /= changedScaleX;
|
|
13879
13885
|
if (useScaleY) scaleY /= changedScaleY;
|
|
13880
13886
|
if (!flipable) {
|
|
13881
|
-
if (scaleX < 0) scaleX = 1 /
|
|
13882
|
-
if (scaleY < 0) scaleY = 1 /
|
|
13887
|
+
if (scaleX < 0) scaleX = 1 / boxBounds.width / worldScaleX;
|
|
13888
|
+
if (scaleY < 0) scaleY = 1 / boxBounds.height / worldScaleY;
|
|
13883
13889
|
}
|
|
13884
|
-
toPoint(around || align,
|
|
13885
|
-
this.checkOrigin(target, origin, boundsType);
|
|
13890
|
+
toPoint(around || align, boxBounds, origin, true);
|
|
13886
13891
|
if (dragBounds) {
|
|
13887
13892
|
const scaleData = {
|
|
13888
13893
|
x: scaleX,
|
|
@@ -13893,19 +13898,15 @@ const EditDataHelper = {
|
|
|
13893
13898
|
scaleY = scaleData.y;
|
|
13894
13899
|
}
|
|
13895
13900
|
if (useScaleX && widthRange) {
|
|
13896
|
-
const nowWidth =
|
|
13901
|
+
const nowWidth = boxBounds.width * target.scaleX;
|
|
13897
13902
|
scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
|
|
13898
13903
|
}
|
|
13899
13904
|
if (useScaleY && heightRange) {
|
|
13900
|
-
const nowHeight =
|
|
13905
|
+
const nowHeight = boxBounds.height * target.scaleY;
|
|
13901
13906
|
scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
|
|
13902
13907
|
}
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
minWidth += (innerBounds.width - boxBounds.width) * worldScaleX;
|
|
13906
|
-
minHeight += (innerBounds.height - boxBounds.height) * worldScaleY;
|
|
13907
|
-
}
|
|
13908
|
-
const worldWidth = worldScaleX * innerBounds.width, worldHeight = worldScaleY * innerBounds.height;
|
|
13908
|
+
const minWidth = 1, minHeight = 1;
|
|
13909
|
+
const worldWidth = worldScaleX * boxBounds.width, worldHeight = worldScaleY * boxBounds.height;
|
|
13909
13910
|
if (useScaleX && abs$4(scaleX * worldWidth) < minWidth) scaleX = sign$1(scaleX) * minWidth / worldWidth;
|
|
13910
13911
|
if (useScaleY && abs$4(scaleY * worldHeight) < minHeight) scaleY = sign$1(scaleY) * minHeight / worldHeight;
|
|
13911
13912
|
if (lockRatio && scaleX !== scaleY) {
|
|
@@ -13924,7 +13925,7 @@ const EditDataHelper = {
|
|
|
13924
13925
|
around: around
|
|
13925
13926
|
};
|
|
13926
13927
|
},
|
|
13927
|
-
getRotateData(target, direction, current, last, around
|
|
13928
|
+
getRotateData(target, direction, current, last, around) {
|
|
13928
13929
|
let align, origin = {};
|
|
13929
13930
|
switch (direction) {
|
|
13930
13931
|
case topLeft$1:
|
|
@@ -13946,14 +13947,13 @@ const EditDataHelper = {
|
|
|
13946
13947
|
default:
|
|
13947
13948
|
align = "center";
|
|
13948
13949
|
}
|
|
13949
|
-
toPoint(around || align, target.
|
|
13950
|
-
this.checkOrigin(target, origin, boundsType);
|
|
13950
|
+
toPoint(around || align, target.boxBounds, origin, true);
|
|
13951
13951
|
return {
|
|
13952
13952
|
origin: origin,
|
|
13953
13953
|
rotation: PointHelper.getRotation(last, target.getWorldPointByBox(origin), current)
|
|
13954
13954
|
};
|
|
13955
13955
|
},
|
|
13956
|
-
getSkewData(target, direction, move, around
|
|
13956
|
+
getSkewData(target, direction, move, around) {
|
|
13957
13957
|
let align, origin = {}, skewX = 0, skewY = 0;
|
|
13958
13958
|
let last;
|
|
13959
13959
|
switch (direction) {
|
|
@@ -13996,12 +13996,10 @@ const EditDataHelper = {
|
|
|
13996
13996
|
align = "left";
|
|
13997
13997
|
skewY = 1;
|
|
13998
13998
|
}
|
|
13999
|
-
const
|
|
14000
|
-
const {width: width, height: height} = innerBounds;
|
|
13999
|
+
const {boxBounds: boxBounds} = target, {width: width, height: height} = boxBounds;
|
|
14001
14000
|
last.x = last.x * width;
|
|
14002
14001
|
last.y = last.y * height;
|
|
14003
|
-
toPoint(around || align,
|
|
14004
|
-
this.checkOrigin(target, origin, boundsType);
|
|
14002
|
+
toPoint(around || align, boxBounds, origin, true);
|
|
14005
14003
|
const rotation = PointHelper.getRotation(last, origin, {
|
|
14006
14004
|
x: last.x + (skewX ? move.x : 0),
|
|
14007
14005
|
y: last.y + (skewY ? move.y : 0)
|
|
@@ -14013,13 +14011,6 @@ const EditDataHelper = {
|
|
|
14013
14011
|
skewY: skewY
|
|
14014
14012
|
};
|
|
14015
14013
|
},
|
|
14016
|
-
checkOrigin(target, origin, boundsType) {
|
|
14017
|
-
if (boundsType !== "box") {
|
|
14018
|
-
const {boxBounds: boxBounds} = target, innerBounds = target.getBounds(boundsType, "inner");
|
|
14019
|
-
origin.x += innerBounds.x - boxBounds.x;
|
|
14020
|
-
origin.y += innerBounds.y - boxBounds.y;
|
|
14021
|
-
}
|
|
14022
|
-
},
|
|
14023
14014
|
getAround(around, altKey) {
|
|
14024
14015
|
return altKey && !around ? "center" : around;
|
|
14025
14016
|
},
|
|
@@ -14314,9 +14305,14 @@ class EditBox extends Group {
|
|
|
14314
14305
|
if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
|
|
14315
14306
|
}
|
|
14316
14307
|
updateBounds(bounds) {
|
|
14317
|
-
const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
|
|
14308
|
+
const {editor: editor, target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
|
|
14318
14309
|
const {editMask: editMask} = editor;
|
|
14319
14310
|
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;
|
|
14311
|
+
if (editBoxType === "stroke") {
|
|
14312
|
+
const {scaleX: scaleX, scaleY: scaleY} = target.worldTransform, {strokeBoxSpread: strokeBoxSpread} = target.__layout;
|
|
14313
|
+
strokeBoxSpread && BoundsHelper.spread(bounds, [ strokeBoxSpread * Math.abs(scaleY), strokeBoxSpread * Math.abs(scaleX) ]);
|
|
14314
|
+
}
|
|
14315
|
+
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14320
14316
|
editMask.visible = mask ? true : 0;
|
|
14321
14317
|
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
14322
14318
|
editor.setDimOthers(dimOthers);
|
|
@@ -14325,8 +14321,6 @@ class EditBox extends Group {
|
|
|
14325
14321
|
} else if (editor.hasDimOthers) {
|
|
14326
14322
|
editor.cancelDimOthers();
|
|
14327
14323
|
}
|
|
14328
|
-
if (editBoxType === "stroke") BoundsHelper.spread(bounds, this.target.__layout.strokeBoxSpread);
|
|
14329
|
-
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14330
14324
|
if (this.view.worldOpacity) {
|
|
14331
14325
|
const {width: width, height: height} = bounds;
|
|
14332
14326
|
const smallSize = isNumber(hideOnSmall) ? hideOnSmall : 10;
|
|
@@ -14463,7 +14457,7 @@ class EditBox extends Group {
|
|
|
14463
14457
|
this.dragPoint = null;
|
|
14464
14458
|
}
|
|
14465
14459
|
onTransformStart(e) {
|
|
14466
|
-
const {hideOnMove: hideOnMove
|
|
14460
|
+
const {hideOnMove: hideOnMove} = this.mergedConfig;
|
|
14467
14461
|
if (this.moving || this.gesturing) this.editor.opacity = hideOnMove ? 0 : 1;
|
|
14468
14462
|
if (this.resizing) ResizeEvent.resizingKeys = this.editor.leafList.keys;
|
|
14469
14463
|
const {dragStartData: dragStartData, target: target} = this;
|
|
@@ -14474,7 +14468,7 @@ class EditBox extends Group {
|
|
|
14474
14468
|
x: target.x,
|
|
14475
14469
|
y: target.y
|
|
14476
14470
|
};
|
|
14477
|
-
dragStartData.bounds = Object.assign({}, target.getLayoutBounds(
|
|
14471
|
+
dragStartData.bounds = Object.assign({}, target.getLayoutBounds("box", "local"));
|
|
14478
14472
|
dragStartData.rotation = target.rotation;
|
|
14479
14473
|
}
|
|
14480
14474
|
onTransformEnd(e) {
|
|
@@ -14847,6 +14841,9 @@ function registerEditTool() {
|
|
|
14847
14841
|
const registerInnerEditor = registerEditTool;
|
|
14848
14842
|
|
|
14849
14843
|
const EditToolCreator = {
|
|
14844
|
+
EditTool: "EditTool",
|
|
14845
|
+
LineEditTool: "LineEditTool",
|
|
14846
|
+
PointsEditTool: "PointsEditTool",
|
|
14850
14847
|
list: {},
|
|
14851
14848
|
register(EditTool, name) {
|
|
14852
14849
|
const {tag: tag} = EditTool.prototype;
|
|
@@ -15038,7 +15035,7 @@ class TransformTool {
|
|
|
15038
15035
|
}
|
|
15039
15036
|
onScale(e) {
|
|
15040
15037
|
const {target: target, mergeConfig: mergeConfig, single: single, dragStartData: dragStartData} = this.editBox;
|
|
15041
|
-
let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize
|
|
15038
|
+
let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize} = mergeConfig, totalMove;
|
|
15042
15039
|
if (e instanceof ZoomEvent) {
|
|
15043
15040
|
if (!around) around = target.getBoxPoint(e);
|
|
15044
15041
|
totalMove = e.totalScale;
|
|
@@ -15047,7 +15044,7 @@ class TransformTool {
|
|
|
15047
15044
|
}
|
|
15048
15045
|
const {direction: direction} = e.current;
|
|
15049
15046
|
if (e.shiftKey || target.lockRatio) lockRatio = true;
|
|
15050
|
-
const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale"
|
|
15047
|
+
const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale");
|
|
15051
15048
|
const targetX = target.x, targetY = target.y;
|
|
15052
15049
|
if (e instanceof DragEvent && this.editTool && this.editTool.onScaleWithDrag) {
|
|
15053
15050
|
data.drag = e;
|
|
@@ -15059,7 +15056,7 @@ class TransformTool {
|
|
|
15059
15056
|
}
|
|
15060
15057
|
onRotate(e) {
|
|
15061
15058
|
const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
|
|
15062
|
-
const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey
|
|
15059
|
+
const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey} = mergeConfig;
|
|
15063
15060
|
const {direction: direction} = e.current;
|
|
15064
15061
|
let origin, rotation;
|
|
15065
15062
|
if (e instanceof RotateEvent) {
|
|
@@ -15067,7 +15064,7 @@ class TransformTool {
|
|
|
15067
15064
|
origin = rotateAround ? AroundHelper.getPoint(rotateAround, target.boxBounds) : target.getBoxPoint(e);
|
|
15068
15065
|
} else {
|
|
15069
15066
|
const isDiagonalRotate = diagonalRotateKey ? e.isHoldKeys(diagonalRotateKey) : e.shiftKey;
|
|
15070
|
-
const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center"
|
|
15067
|
+
const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center");
|
|
15071
15068
|
rotation = dragStartData.rotation + data.rotation - target.rotation;
|
|
15072
15069
|
origin = data.origin;
|
|
15073
15070
|
}
|
|
@@ -15079,8 +15076,8 @@ class TransformTool {
|
|
|
15079
15076
|
}
|
|
15080
15077
|
onSkew(e) {
|
|
15081
15078
|
const {target: target, mergeConfig: mergeConfig} = this.editBox;
|
|
15082
|
-
const {around: around
|
|
15083
|
-
const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey)
|
|
15079
|
+
const {around: around} = mergeConfig;
|
|
15080
|
+
const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey));
|
|
15084
15081
|
if (!skewX && !skewY) return;
|
|
15085
15082
|
this.skewOf(origin, skewX, skewY);
|
|
15086
15083
|
}
|
|
@@ -15141,7 +15138,7 @@ class TransformTool {
|
|
|
15141
15138
|
scaleOf(origin, scaleX, scaleY = scaleX, _resize) {
|
|
15142
15139
|
if (!this.checkTransform("resizeable")) return;
|
|
15143
15140
|
const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
|
|
15144
|
-
const {beforeScale: beforeScale
|
|
15141
|
+
const {beforeScale: beforeScale} = mergeConfig;
|
|
15145
15142
|
if (beforeScale) {
|
|
15146
15143
|
const check = beforeScale({
|
|
15147
15144
|
target: target,
|
|
@@ -15159,8 +15156,7 @@ class TransformTool {
|
|
|
15159
15156
|
worldOrigin: worldOrigin,
|
|
15160
15157
|
scaleX: scaleX,
|
|
15161
15158
|
scaleY: scaleY,
|
|
15162
|
-
transform: transform
|
|
15163
|
-
editBoxType: editBoxType
|
|
15159
|
+
transform: transform
|
|
15164
15160
|
};
|
|
15165
15161
|
this.emitEvent(new EditorScaleEvent(EditorScaleEvent.BEFORE_SCALE, data));
|
|
15166
15162
|
const event = new EditorScaleEvent(EditorScaleEvent.SCALE, data);
|
|
@@ -15188,7 +15184,7 @@ class TransformTool {
|
|
|
15188
15184
|
rotateOf(origin, rotation) {
|
|
15189
15185
|
if (!this.checkTransform("rotateable")) return;
|
|
15190
15186
|
const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
|
|
15191
|
-
const {beforeRotate: beforeRotate
|
|
15187
|
+
const {beforeRotate: beforeRotate} = mergeConfig;
|
|
15192
15188
|
if (beforeRotate) {
|
|
15193
15189
|
const check = beforeRotate({
|
|
15194
15190
|
target: target,
|
|
@@ -15204,8 +15200,7 @@ class TransformTool {
|
|
|
15204
15200
|
editor: editor,
|
|
15205
15201
|
worldOrigin: worldOrigin,
|
|
15206
15202
|
rotation: rotation,
|
|
15207
|
-
transform: transform
|
|
15208
|
-
editBoxType: editBoxType
|
|
15203
|
+
transform: transform
|
|
15209
15204
|
};
|
|
15210
15205
|
this.emitEvent(new EditorRotateEvent(EditorRotateEvent.BEFORE_ROTATE, data));
|
|
15211
15206
|
const event = new EditorRotateEvent(EditorRotateEvent.ROTATE, data);
|
|
@@ -15215,7 +15210,7 @@ class TransformTool {
|
|
|
15215
15210
|
skewOf(origin, skewX, skewY = 0, _resize) {
|
|
15216
15211
|
if (!this.checkTransform("skewable")) return;
|
|
15217
15212
|
const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
|
|
15218
|
-
const {beforeSkew: beforeSkew
|
|
15213
|
+
const {beforeSkew: beforeSkew} = mergeConfig;
|
|
15219
15214
|
if (beforeSkew) {
|
|
15220
15215
|
const check = beforeSkew({
|
|
15221
15216
|
target: target,
|
|
@@ -15233,8 +15228,7 @@ class TransformTool {
|
|
|
15233
15228
|
worldOrigin: worldOrigin,
|
|
15234
15229
|
skewX: skewX,
|
|
15235
15230
|
skewY: skewY,
|
|
15236
|
-
transform: transform
|
|
15237
|
-
editBoxType: editBoxType
|
|
15231
|
+
transform: transform
|
|
15238
15232
|
};
|
|
15239
15233
|
this.emitEvent(new EditorSkewEvent(EditorSkewEvent.BEFORE_SKEW, data));
|
|
15240
15234
|
const event = new EditorSkewEvent(EditorSkewEvent.SKEW, data);
|
|
@@ -15690,32 +15684,32 @@ let EditTool = class EditTool extends InnerEditor {
|
|
|
15690
15684
|
app.unlockLayout();
|
|
15691
15685
|
}
|
|
15692
15686
|
onScale(e) {
|
|
15693
|
-
const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor
|
|
15687
|
+
const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
|
|
15694
15688
|
const {app: app, list: list} = editor;
|
|
15695
15689
|
app.lockLayout();
|
|
15696
15690
|
list.forEach(target => {
|
|
15697
15691
|
const resize = editor.getEditSize(target) !== "scale";
|
|
15698
|
-
if (transform) target.transformWorld(transform, resize, false
|
|
15692
|
+
if (transform) target.transformWorld(transform, resize, false); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize, false);
|
|
15699
15693
|
});
|
|
15700
15694
|
app.unlockLayout();
|
|
15701
15695
|
}
|
|
15702
15696
|
onRotate(e) {
|
|
15703
|
-
const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor
|
|
15697
|
+
const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
|
|
15704
15698
|
const {app: app, list: list} = editor;
|
|
15705
15699
|
app.lockLayout();
|
|
15706
15700
|
list.forEach(target => {
|
|
15707
15701
|
const resize = editor.getEditSize(target) !== "scale";
|
|
15708
|
-
if (transform) target.transformWorld(transform, resize, false
|
|
15702
|
+
if (transform) target.transformWorld(transform, resize, false); else target.rotateOfWorld(worldOrigin, rotation);
|
|
15709
15703
|
});
|
|
15710
15704
|
app.unlockLayout();
|
|
15711
15705
|
}
|
|
15712
15706
|
onSkew(e) {
|
|
15713
|
-
const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor
|
|
15707
|
+
const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
|
|
15714
15708
|
const {app: app, list: list} = editor;
|
|
15715
15709
|
app.lockLayout();
|
|
15716
15710
|
list.forEach(target => {
|
|
15717
15711
|
const resize = editor.getEditSize(target) !== "scale";
|
|
15718
|
-
if (transform) target.transformWorld(transform, resize, false
|
|
15712
|
+
if (transform) target.transformWorld(transform, resize, false); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
|
|
15719
15713
|
});
|
|
15720
15714
|
app.unlockLayout();
|
|
15721
15715
|
}
|
|
@@ -16115,8 +16109,10 @@ UI.addAttr("editConfig", undefined, dataType);
|
|
|
16115
16109
|
|
|
16116
16110
|
UI.addAttr("editOuter", ui => {
|
|
16117
16111
|
ui.updateLayout();
|
|
16118
|
-
const
|
|
16119
|
-
|
|
16112
|
+
const {EditTool: EditTool, LineEditTool: LineEditTool, PointsEditTool: PointsEditTool} = EditToolCreator;
|
|
16113
|
+
const name = ui.pathInputed || ui.isPointsMode ? PointsEditTool : ui.tag + "EditTool";
|
|
16114
|
+
const hasTool = EditToolCreator.list[name];
|
|
16115
|
+
return ui.__.__isLinePath && !(name == PointsEditTool && hasTool) ? LineEditTool : hasTool ? name : EditTool;
|
|
16120
16116
|
}, dataType);
|
|
16121
16117
|
|
|
16122
16118
|
UI.addAttr("editInner", "PathEditor", dataType);
|