@leafer/worker 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.js +56 -58
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +57 -58
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +22 -22
package/dist/worker.module.js
CHANGED
|
@@ -54,7 +54,7 @@ function isUndefined(value) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function isNull(value) {
|
|
57
|
-
return value
|
|
57
|
+
return value == null;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
function isString(value) {
|
|
@@ -304,6 +304,9 @@ const MathHelper = {
|
|
|
304
304
|
num = round$6(num * a) / a;
|
|
305
305
|
return num === -0 ? 0 : num;
|
|
306
306
|
},
|
|
307
|
+
sign(num) {
|
|
308
|
+
return num < 0 ? -1 : 1;
|
|
309
|
+
},
|
|
307
310
|
getScaleData(scale, size, originSize, scaleData) {
|
|
308
311
|
if (!scaleData) scaleData = {};
|
|
309
312
|
if (size) {
|
|
@@ -659,7 +662,7 @@ const M$a = MatrixHelper;
|
|
|
659
662
|
|
|
660
663
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
661
664
|
|
|
662
|
-
const {sin: sin$5, cos: cos$5, abs: abs$
|
|
665
|
+
const {sin: sin$5, cos: cos$5, abs: abs$7, sqrt: sqrt$4, atan2: atan2$2, min: min$1, round: round$5} = Math;
|
|
663
666
|
|
|
664
667
|
const PointHelper = {
|
|
665
668
|
defaultPoint: getPointData(),
|
|
@@ -752,8 +755,8 @@ const PointHelper = {
|
|
|
752
755
|
return getDistanceFrom(t.x, t.y, point.x, point.y);
|
|
753
756
|
},
|
|
754
757
|
getDistanceFrom(x1, y1, x2, y2) {
|
|
755
|
-
const x = abs$
|
|
756
|
-
const y = abs$
|
|
758
|
+
const x = abs$7(x2 - x1);
|
|
759
|
+
const y = abs$7(y2 - y1);
|
|
757
760
|
return sqrt$4(x * x + y * y);
|
|
758
761
|
},
|
|
759
762
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
@@ -2540,7 +2543,7 @@ const RectHelper = {
|
|
|
2540
2543
|
}
|
|
2541
2544
|
};
|
|
2542
2545
|
|
|
2543
|
-
const {sin: sin$4, cos: cos$4, atan2: atan2$1, ceil: ceil$1, abs: abs$
|
|
2546
|
+
const {sin: sin$4, cos: cos$4, atan2: atan2$1, ceil: ceil$1, abs: abs$6, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
|
|
2544
2547
|
|
|
2545
2548
|
const {setPoint: setPoint$4, addPoint: addPoint$2} = TwoPointBoundsHelper;
|
|
2546
2549
|
|
|
@@ -2613,7 +2616,7 @@ const BezierHelper = {
|
|
|
2613
2616
|
let endRadian = atan2$1(CBy, CBx);
|
|
2614
2617
|
let totalRadian = endRadian - startRadian;
|
|
2615
2618
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2616
|
-
if (totalRadian === PI$3 || abs$
|
|
2619
|
+
if (totalRadian === PI$3 || abs$6(BAx + BAy) < 1e-12 || abs$6(CBx + CBy) < 1e-12) {
|
|
2617
2620
|
if (data) data.push(L$a, x1, y1);
|
|
2618
2621
|
if (setPointBounds) {
|
|
2619
2622
|
setPoint$4(setPointBounds, fromX, fromY);
|
|
@@ -2646,7 +2649,7 @@ const BezierHelper = {
|
|
|
2646
2649
|
let totalRadian = endRadian - startRadian;
|
|
2647
2650
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2648
2651
|
if (anticlockwise) totalRadian -= PI2;
|
|
2649
|
-
const parts = ceil$1(abs$
|
|
2652
|
+
const parts = ceil$1(abs$6(totalRadian / PI_2));
|
|
2650
2653
|
const partRadian = totalRadian / parts;
|
|
2651
2654
|
const partRadian4Sin = sin$4(partRadian / 4);
|
|
2652
2655
|
const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$4(partRadian / 2);
|
|
@@ -3113,7 +3116,7 @@ const {M: M$7, L: L$8, C: C$6, Q: Q$5, Z: Z$6, N: N$4, D: D$5, X: X$4, G: G$4, F
|
|
|
3113
3116
|
|
|
3114
3117
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3115
3118
|
|
|
3116
|
-
const {tan: tan, min: min, abs: abs$
|
|
3119
|
+
const {tan: tan, min: min, abs: abs$5} = Math;
|
|
3117
3120
|
|
|
3118
3121
|
const startPoint = {};
|
|
3119
3122
|
|
|
@@ -3171,7 +3174,7 @@ const PathCommandDataHelper = {
|
|
|
3171
3174
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
|
|
3172
3175
|
if (!isUndefined(lastX)) {
|
|
3173
3176
|
const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
|
|
3174
|
-
radius = min(radius, min(d / 2, d / 2 * abs$
|
|
3177
|
+
radius = min(radius, min(d / 2, d / 2 * abs$5(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3175
3178
|
}
|
|
3176
3179
|
data.push(U$4, x1, y1, x2, y2, radius);
|
|
3177
3180
|
},
|
|
@@ -3969,7 +3972,7 @@ const I$1 = ImageManager;
|
|
|
3969
3972
|
|
|
3970
3973
|
const {IMAGE: IMAGE, create: create$1} = IncrementId;
|
|
3971
3974
|
|
|
3972
|
-
const {floor: floor$2, max: max$
|
|
3975
|
+
const {floor: floor$2, max: max$2} = Math;
|
|
3973
3976
|
|
|
3974
3977
|
class LeaferImage {
|
|
3975
3978
|
get url() {
|
|
@@ -4058,7 +4061,7 @@ class LeaferImage {
|
|
|
4058
4061
|
}
|
|
4059
4062
|
if (data) return data;
|
|
4060
4063
|
}
|
|
4061
|
-
const canvas = Platform.origin.createCanvas(max$
|
|
4064
|
+
const canvas = Platform.origin.createCanvas(max$2(floor$2(width + (xGap || 0)), 1), max$2(floor$2(height + (yGap || 0)), 1));
|
|
4062
4065
|
const ctx = canvas.getContext("2d");
|
|
4063
4066
|
if (opacity) ctx.globalAlpha = opacity;
|
|
4064
4067
|
ctx.drawImage(this.view, 0, 0, width, height);
|
|
@@ -4102,7 +4105,7 @@ function createDescriptor(key, defaultValue) {
|
|
|
4102
4105
|
return {
|
|
4103
4106
|
get() {
|
|
4104
4107
|
const v = this[privateKey];
|
|
4105
|
-
return
|
|
4108
|
+
return v == null ? defaultValue : v;
|
|
4106
4109
|
},
|
|
4107
4110
|
set(value) {
|
|
4108
4111
|
this[privateKey] = value;
|
|
@@ -4388,21 +4391,21 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4388
4391
|
};
|
|
4389
4392
|
} else if (typeof defaultValue === "function") {
|
|
4390
4393
|
property.get = function() {
|
|
4391
|
-
|
|
4392
|
-
return v
|
|
4394
|
+
const v = this[computedKey];
|
|
4395
|
+
return v == null ? defaultValue(this.__leaf) : v;
|
|
4393
4396
|
};
|
|
4394
4397
|
} else if (isObject(defaultValue)) {
|
|
4395
4398
|
const isEmpty = isEmptyData(defaultValue);
|
|
4396
4399
|
property.get = function() {
|
|
4397
|
-
|
|
4398
|
-
return v
|
|
4400
|
+
const v = this[computedKey];
|
|
4401
|
+
return v == null ? this[computedKey] = isEmpty ? {} : DataHelper.clone(defaultValue) : v;
|
|
4399
4402
|
};
|
|
4400
4403
|
}
|
|
4401
4404
|
const isBox = target.isBranchLeaf;
|
|
4402
4405
|
if (key === "width") {
|
|
4403
4406
|
property.get = function() {
|
|
4404
4407
|
const v = this[computedKey];
|
|
4405
|
-
if (v
|
|
4408
|
+
if (v == null) {
|
|
4406
4409
|
const t = this, naturalWidth = t.__naturalWidth, leaf = t.__leaf;
|
|
4407
4410
|
if (!defaultValue || leaf.pathInputed) return leaf.boxBounds.width;
|
|
4408
4411
|
if (naturalWidth) return t._height && t.__useNaturalRatio ? t._height * naturalWidth / t.__naturalHeight : naturalWidth;
|
|
@@ -4412,7 +4415,7 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4412
4415
|
} else if (key === "height") {
|
|
4413
4416
|
property.get = function() {
|
|
4414
4417
|
const v = this[computedKey];
|
|
4415
|
-
if (v
|
|
4418
|
+
if (v == null) {
|
|
4416
4419
|
const t = this, naturalHeight = t.__naturalHeight, leaf = t.__leaf;
|
|
4417
4420
|
if (!defaultValue || leaf.pathInputed) return leaf.boxBounds.height;
|
|
4418
4421
|
if (naturalHeight) return t._width && t.__useNaturalRatio ? t._width * naturalHeight / t.__naturalWidth : naturalHeight;
|
|
@@ -5172,7 +5175,7 @@ class LeafLayout {
|
|
|
5172
5175
|
}
|
|
5173
5176
|
boxChange() {
|
|
5174
5177
|
this.boxChanged = true;
|
|
5175
|
-
this.localBoxChanged || this.localBoxChange();
|
|
5178
|
+
this.localBoxChanged ? this.boundsChanged || (this.boundsChanged = true) : this.localBoxChange();
|
|
5176
5179
|
this.hitCanvasChanged = true;
|
|
5177
5180
|
}
|
|
5178
5181
|
localBoxChange() {
|
|
@@ -5206,7 +5209,7 @@ class LeafLayout {
|
|
|
5206
5209
|
}
|
|
5207
5210
|
matrixChange() {
|
|
5208
5211
|
this.matrixChanged = true;
|
|
5209
|
-
this.localBoxChanged || this.localBoxChange();
|
|
5212
|
+
this.localBoxChanged ? this.boundsChanged || (this.boundsChanged = true) : this.localBoxChange();
|
|
5210
5213
|
}
|
|
5211
5214
|
surfaceChange() {
|
|
5212
5215
|
this.surfaceChanged = true;
|
|
@@ -6272,10 +6275,10 @@ let Leaf = class Leaf {
|
|
|
6272
6275
|
relative.innerToWorld(world, to, distance);
|
|
6273
6276
|
world = to ? to : world;
|
|
6274
6277
|
}
|
|
6275
|
-
toInnerPoint(this.
|
|
6278
|
+
toInnerPoint(this.scrollWorldTransform, world, to, distance);
|
|
6276
6279
|
}
|
|
6277
6280
|
innerToWorld(inner, to, distance, relative) {
|
|
6278
|
-
toOuterPoint(this.
|
|
6281
|
+
toOuterPoint(this.scrollWorldTransform, inner, to, distance);
|
|
6279
6282
|
if (relative) relative.worldToInner(to ? to : inner, null, distance);
|
|
6280
6283
|
}
|
|
6281
6284
|
getBoxPoint(world, relative, distance, change) {
|
|
@@ -6739,7 +6742,7 @@ class LeafLevelList {
|
|
|
6739
6742
|
}
|
|
6740
6743
|
}
|
|
6741
6744
|
|
|
6742
|
-
const version = "1.9.
|
|
6745
|
+
const version = "1.9.4";
|
|
6743
6746
|
|
|
6744
6747
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6745
6748
|
get allowBackgroundColor() {
|
|
@@ -8938,29 +8941,24 @@ let Box = class Box extends Group {
|
|
|
8938
8941
|
}
|
|
8939
8942
|
__updateStrokeBounds() {}
|
|
8940
8943
|
__updateRenderBounds() {
|
|
8941
|
-
let isOverflow;
|
|
8944
|
+
let isOverflow, isScrollMode;
|
|
8942
8945
|
if (this.children.length) {
|
|
8943
|
-
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout;
|
|
8946
|
+
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
8944
8947
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
8945
8948
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
8946
|
-
if (
|
|
8949
|
+
if (isScrollMode = overflow.includes("scroll")) {
|
|
8947
8950
|
add(childrenRenderBounds, boxBounds);
|
|
8948
8951
|
scroll(childrenRenderBounds, data);
|
|
8949
8952
|
}
|
|
8950
8953
|
this.__updateRectRenderBounds();
|
|
8951
8954
|
isOverflow = !includes$1(boxBounds, childrenRenderBounds);
|
|
8952
|
-
if (isOverflow &&
|
|
8955
|
+
if (isOverflow && overflow === "show") add(renderBounds, childrenRenderBounds);
|
|
8953
8956
|
} else this.__updateRectRenderBounds();
|
|
8954
8957
|
DataHelper.stintSet(this, "isOverflow", isOverflow);
|
|
8955
|
-
this.__checkScroll();
|
|
8958
|
+
this.__checkScroll(isScrollMode);
|
|
8956
8959
|
}
|
|
8957
8960
|
__updateRectRenderBounds() {}
|
|
8958
|
-
|
|
8959
|
-
if (this.hasScroller) this.__updateScroll();
|
|
8960
|
-
super.__updateWorldBounds();
|
|
8961
|
-
}
|
|
8962
|
-
__checkScroll() {}
|
|
8963
|
-
__updateScroll() {}
|
|
8961
|
+
__checkScroll(_isScrollMode) {}
|
|
8964
8962
|
__updateRectChange() {}
|
|
8965
8963
|
__updateChange() {
|
|
8966
8964
|
super.__updateChange();
|
|
@@ -11572,7 +11570,7 @@ function ignoreRender(ui, value) {
|
|
|
11572
11570
|
|
|
11573
11571
|
const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
|
|
11574
11572
|
|
|
11575
|
-
const {floor: floor$1, max: max, abs: abs$
|
|
11573
|
+
const {floor: floor$1, max: max$1, abs: abs$4} = Math;
|
|
11576
11574
|
|
|
11577
11575
|
function createPattern(ui, paint, pixelRatio) {
|
|
11578
11576
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, paint.scaleFixed);
|
|
@@ -11585,8 +11583,8 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
11585
11583
|
const xGap = gap && gap.x * scaleX;
|
|
11586
11584
|
const yGap = gap && gap.y * scaleY;
|
|
11587
11585
|
if (sx) {
|
|
11588
|
-
sx = abs$
|
|
11589
|
-
sy = abs$
|
|
11586
|
+
sx = abs$4(sx);
|
|
11587
|
+
sy = abs$4(sy);
|
|
11590
11588
|
imageMatrix = get$1();
|
|
11591
11589
|
copy$4(imageMatrix, transform);
|
|
11592
11590
|
scale$2(imageMatrix, 1 / sx, 1 / sy);
|
|
@@ -11624,7 +11622,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
11624
11622
|
}
|
|
11625
11623
|
if (imageMatrix) {
|
|
11626
11624
|
const canvasWidth = width + (xGap || 0), canvasHeight = height + (yGap || 0);
|
|
11627
|
-
scale$2(imageMatrix, canvasWidth / max(floor$1(canvasWidth), 1), canvasHeight / max(floor$1(canvasHeight), 1));
|
|
11625
|
+
scale$2(imageMatrix, canvasWidth / max$1(floor$1(canvasWidth), 1), canvasHeight / max$1(floor$1(canvasHeight), 1));
|
|
11628
11626
|
}
|
|
11629
11627
|
const canvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap);
|
|
11630
11628
|
const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
|
|
@@ -12648,7 +12646,7 @@ function mergeConfigAttr() {
|
|
|
12648
12646
|
return (target, key) => {
|
|
12649
12647
|
defineKey(target, key, {
|
|
12650
12648
|
get() {
|
|
12651
|
-
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox} = this, mergeConfig = Object.assign({}, config);
|
|
12649
|
+
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
12652
12650
|
if (element && element.editConfig) Object.assign(mergeConfig, element.editConfig);
|
|
12653
12651
|
if (editBox.config) Object.assign(mergeConfig, editBox.config);
|
|
12654
12652
|
if (dragPoint) {
|
|
@@ -12659,13 +12657,14 @@ function mergeConfigAttr() {
|
|
|
12659
12657
|
isNull(mergeConfig.lockRatio) && (mergeConfig.lockRatio = true);
|
|
12660
12658
|
}
|
|
12661
12659
|
}
|
|
12660
|
+
if (isUndefined(mergeConfig.dragLimitAnimate)) mergeConfig.dragLimitAnimate = app && app.config.pointer.dragLimitAnimate;
|
|
12662
12661
|
return this.mergedConfig = mergeConfig;
|
|
12663
12662
|
}
|
|
12664
12663
|
});
|
|
12665
12664
|
};
|
|
12666
12665
|
}
|
|
12667
12666
|
|
|
12668
|
-
const {abs: abs$
|
|
12667
|
+
const {abs: abs$3} = Math;
|
|
12669
12668
|
|
|
12670
12669
|
const {copy: copy$2, scale: scale$1} = MatrixHelper;
|
|
12671
12670
|
|
|
@@ -12708,7 +12707,7 @@ class Stroker extends UI {
|
|
|
12708
12707
|
leaf = list[i];
|
|
12709
12708
|
const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
|
|
12710
12709
|
if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
|
|
12711
|
-
const aScaleX = abs$
|
|
12710
|
+
const aScaleX = abs$3(worldTransform.scaleX), aScaleY = abs$3(worldTransform.scaleY);
|
|
12712
12711
|
copy$2(matrix$1, worldTransform);
|
|
12713
12712
|
matrix$1.half = strokeWidth % 2;
|
|
12714
12713
|
if (aScaleX !== aScaleY) {
|
|
@@ -12722,7 +12721,7 @@ class Stroker extends UI {
|
|
|
12722
12721
|
canvas.setWorld(matrix$1, options.matrix);
|
|
12723
12722
|
canvas.beginPath();
|
|
12724
12723
|
if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
|
|
12725
|
-
data.strokeWidth = strokeWidth / abs$
|
|
12724
|
+
data.strokeWidth = strokeWidth / abs$3(worldTransform.scaleX);
|
|
12726
12725
|
}
|
|
12727
12726
|
if (stroke) isString(stroke) ? Paint.stroke(stroke, this, canvas) : Paint.strokes(stroke, this, canvas);
|
|
12728
12727
|
if (fill) isString(fill) ? Paint.fill(fill, this, canvas) : Paint.fills(fill, this, canvas);
|
|
@@ -13016,7 +13015,7 @@ const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bot
|
|
|
13016
13015
|
|
|
13017
13016
|
const {toPoint: toPoint} = AroundHelper;
|
|
13018
13017
|
|
|
13019
|
-
const {within: within$
|
|
13018
|
+
const {within: within$3, sign: sign$1} = MathHelper;
|
|
13020
13019
|
|
|
13021
13020
|
const EditDataHelper = {
|
|
13022
13021
|
getScaleData(target, startBounds, direction, totalMove, lockRatio, around, flipable, scaleMode) {
|
|
@@ -13029,8 +13028,8 @@ const EditDataHelper = {
|
|
|
13029
13028
|
}
|
|
13030
13029
|
const originChangedScaleX = target.scaleX / startBounds.scaleX;
|
|
13031
13030
|
const originChangedScaleY = target.scaleY / startBounds.scaleY;
|
|
13032
|
-
const signX = originChangedScaleX
|
|
13033
|
-
const signY = originChangedScaleY
|
|
13031
|
+
const signX = sign$1(originChangedScaleX);
|
|
13032
|
+
const signY = sign$1(originChangedScaleY);
|
|
13034
13033
|
const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
|
|
13035
13034
|
const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
|
|
13036
13035
|
totalMove.x *= scaleMode ? originChangedScaleX : signX;
|
|
@@ -13130,14 +13129,14 @@ const EditDataHelper = {
|
|
|
13130
13129
|
}
|
|
13131
13130
|
if (useScaleX && widthRange) {
|
|
13132
13131
|
const nowWidth = boxBounds.width * target.scaleX;
|
|
13133
|
-
scaleX = within$
|
|
13132
|
+
scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
|
|
13134
13133
|
}
|
|
13135
13134
|
if (useScaleY && heightRange) {
|
|
13136
13135
|
const nowHeight = boxBounds.height * target.scaleY;
|
|
13137
|
-
scaleY = within$
|
|
13136
|
+
scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
|
|
13138
13137
|
}
|
|
13139
|
-
if (useScaleX && Math.abs(scaleX * worldBoxBounds.width) < 1) scaleX = (scaleX
|
|
13140
|
-
if (useScaleY && Math.abs(scaleY * worldBoxBounds.height) < 1) scaleY = (scaleY
|
|
13138
|
+
if (useScaleX && Math.abs(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
|
|
13139
|
+
if (useScaleY && Math.abs(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
|
|
13141
13140
|
if (lockRatio && scaleX !== scaleY) scaleY = scaleX = Math.min(scaleX, scaleY);
|
|
13142
13141
|
return {
|
|
13143
13142
|
origin: origin,
|
|
@@ -13639,7 +13638,7 @@ class EditBox extends Group {
|
|
|
13639
13638
|
if (pointType && pointType.includes("resize")) ResizeEvent.resizingKeys = editor.leafList.keys;
|
|
13640
13639
|
}
|
|
13641
13640
|
onDragEnd(e) {
|
|
13642
|
-
if (this.moving) this.transformTool.onMove(e);
|
|
13641
|
+
if (this.moving && this.mergeConfig.dragLimitAnimate && this.target.dragBounds) this.transformTool.onMove(e);
|
|
13643
13642
|
this.dragPoint = null;
|
|
13644
13643
|
this.resetDoing();
|
|
13645
13644
|
const {name: name, pointType: pointType} = e.current;
|
|
@@ -14159,9 +14158,8 @@ EditorSkewEvent.SKEW = "editor.skew";
|
|
|
14159
14158
|
|
|
14160
14159
|
class TransformTool {
|
|
14161
14160
|
onMove(e) {
|
|
14162
|
-
const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData
|
|
14161
|
+
const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
|
|
14163
14162
|
let move, {dragLimitAnimate: dragLimitAnimate} = mergeConfig;
|
|
14164
|
-
if (isUndefined(dragLimitAnimate)) dragLimitAnimate = app && app.config.pointer.dragLimitAnimate;
|
|
14165
14163
|
const isMoveEnd = e.type === MoveEvent.END || e.type === DragEvent.END;
|
|
14166
14164
|
const axisDrag = isString(target.draggable);
|
|
14167
14165
|
const checkLimitMove = !dragLimitAnimate || isMoveEnd || axisDrag;
|
|
@@ -15570,6 +15568,8 @@ const MultiTouchHelper = {
|
|
|
15570
15568
|
}
|
|
15571
15569
|
};
|
|
15572
15570
|
|
|
15571
|
+
const {abs: abs$2, max: max} = Math, {sign: sign, within: within$2} = MathHelper;
|
|
15572
|
+
|
|
15573
15573
|
const WheelEventHelper = {
|
|
15574
15574
|
getMove(event, config) {
|
|
15575
15575
|
let {moveSpeed: moveSpeed} = config;
|
|
@@ -15578,8 +15578,9 @@ const WheelEventHelper = {
|
|
|
15578
15578
|
deltaX = deltaY;
|
|
15579
15579
|
deltaY = 0;
|
|
15580
15580
|
}
|
|
15581
|
-
|
|
15582
|
-
if (
|
|
15581
|
+
const absX = abs$2(deltaX), absY = abs$2(deltaY);
|
|
15582
|
+
if (absX > 50) deltaX = max(50, absX / 3) * sign(deltaX);
|
|
15583
|
+
if (absY > 50) deltaY = max(50, absY / 3) * sign(deltaY);
|
|
15583
15584
|
return {
|
|
15584
15585
|
x: -deltaX * moveSpeed * 2,
|
|
15585
15586
|
y: -deltaY * moveSpeed * 2
|
|
@@ -15597,11 +15598,9 @@ const WheelEventHelper = {
|
|
|
15597
15598
|
zoom = !event.shiftKey && (event.metaKey || event.ctrlKey);
|
|
15598
15599
|
}
|
|
15599
15600
|
if (zoom) {
|
|
15600
|
-
zoomSpeed =
|
|
15601
|
+
zoomSpeed = within$2(zoomSpeed, 0, 1);
|
|
15601
15602
|
const min = event.deltaY ? config.delta.y : config.delta.x;
|
|
15602
|
-
scale = 1 - delta / (min * 4) * zoomSpeed;
|
|
15603
|
-
if (scale < .5) scale = .5;
|
|
15604
|
-
if (scale >= 1.5) scale = 1.5;
|
|
15603
|
+
scale = within$2(1 - delta / (min * 4) * zoomSpeed, .5, 1.5);
|
|
15605
15604
|
}
|
|
15606
15605
|
return scale;
|
|
15607
15606
|
}
|