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