@leafer/miniapp 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/miniapp.module.js +57 -58
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +20 -20
package/dist/miniapp.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() {
|
|
@@ -9089,29 +9092,24 @@ let Box = class Box extends Group {
|
|
|
9089
9092
|
}
|
|
9090
9093
|
__updateStrokeBounds() {}
|
|
9091
9094
|
__updateRenderBounds() {
|
|
9092
|
-
let isOverflow;
|
|
9095
|
+
let isOverflow, isScrollMode;
|
|
9093
9096
|
if (this.children.length) {
|
|
9094
|
-
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout;
|
|
9097
|
+
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
9095
9098
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
9096
9099
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
9097
|
-
if (
|
|
9100
|
+
if (isScrollMode = overflow.includes("scroll")) {
|
|
9098
9101
|
add(childrenRenderBounds, boxBounds);
|
|
9099
9102
|
scroll(childrenRenderBounds, data);
|
|
9100
9103
|
}
|
|
9101
9104
|
this.__updateRectRenderBounds();
|
|
9102
9105
|
isOverflow = !includes$1(boxBounds, childrenRenderBounds);
|
|
9103
|
-
if (isOverflow &&
|
|
9106
|
+
if (isOverflow && overflow === "show") add(renderBounds, childrenRenderBounds);
|
|
9104
9107
|
} else this.__updateRectRenderBounds();
|
|
9105
9108
|
DataHelper.stintSet(this, "isOverflow", isOverflow);
|
|
9106
|
-
this.__checkScroll();
|
|
9109
|
+
this.__checkScroll(isScrollMode);
|
|
9107
9110
|
}
|
|
9108
9111
|
__updateRectRenderBounds() {}
|
|
9109
|
-
|
|
9110
|
-
if (this.hasScroller) this.__updateScroll();
|
|
9111
|
-
super.__updateWorldBounds();
|
|
9112
|
-
}
|
|
9113
|
-
__checkScroll() {}
|
|
9114
|
-
__updateScroll() {}
|
|
9112
|
+
__checkScroll(_isScrollMode) {}
|
|
9115
9113
|
__updateRectChange() {}
|
|
9116
9114
|
__updateChange() {
|
|
9117
9115
|
super.__updateChange();
|
|
@@ -11835,7 +11833,7 @@ function ignoreRender(ui, value) {
|
|
|
11835
11833
|
|
|
11836
11834
|
const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
|
|
11837
11835
|
|
|
11838
|
-
const {floor: floor$1, max: max, abs: abs$
|
|
11836
|
+
const {floor: floor$1, max: max$1, abs: abs$4} = Math;
|
|
11839
11837
|
|
|
11840
11838
|
function createPattern(ui, paint, pixelRatio) {
|
|
11841
11839
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, paint.scaleFixed);
|
|
@@ -11848,8 +11846,8 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
11848
11846
|
const xGap = gap && gap.x * scaleX;
|
|
11849
11847
|
const yGap = gap && gap.y * scaleY;
|
|
11850
11848
|
if (sx) {
|
|
11851
|
-
sx = abs$
|
|
11852
|
-
sy = abs$
|
|
11849
|
+
sx = abs$4(sx);
|
|
11850
|
+
sy = abs$4(sy);
|
|
11853
11851
|
imageMatrix = get$1();
|
|
11854
11852
|
copy$4(imageMatrix, transform);
|
|
11855
11853
|
scale$2(imageMatrix, 1 / sx, 1 / sy);
|
|
@@ -11887,7 +11885,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
11887
11885
|
}
|
|
11888
11886
|
if (imageMatrix) {
|
|
11889
11887
|
const canvasWidth = width + (xGap || 0), canvasHeight = height + (yGap || 0);
|
|
11890
|
-
scale$2(imageMatrix, canvasWidth / max(floor$1(canvasWidth), 1), canvasHeight / max(floor$1(canvasHeight), 1));
|
|
11888
|
+
scale$2(imageMatrix, canvasWidth / max$1(floor$1(canvasWidth), 1), canvasHeight / max$1(floor$1(canvasHeight), 1));
|
|
11891
11889
|
}
|
|
11892
11890
|
const canvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap);
|
|
11893
11891
|
const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
|
|
@@ -12917,7 +12915,7 @@ function mergeConfigAttr() {
|
|
|
12917
12915
|
return (target, key) => {
|
|
12918
12916
|
defineKey(target, key, {
|
|
12919
12917
|
get() {
|
|
12920
|
-
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox} = this, mergeConfig = Object.assign({}, config);
|
|
12918
|
+
const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, app: app} = this, mergeConfig = Object.assign({}, config);
|
|
12921
12919
|
if (element && element.editConfig) Object.assign(mergeConfig, element.editConfig);
|
|
12922
12920
|
if (editBox.config) Object.assign(mergeConfig, editBox.config);
|
|
12923
12921
|
if (dragPoint) {
|
|
@@ -12928,13 +12926,14 @@ function mergeConfigAttr() {
|
|
|
12928
12926
|
isNull(mergeConfig.lockRatio) && (mergeConfig.lockRatio = true);
|
|
12929
12927
|
}
|
|
12930
12928
|
}
|
|
12929
|
+
if (isUndefined(mergeConfig.dragLimitAnimate)) mergeConfig.dragLimitAnimate = app && app.config.pointer.dragLimitAnimate;
|
|
12931
12930
|
return this.mergedConfig = mergeConfig;
|
|
12932
12931
|
}
|
|
12933
12932
|
});
|
|
12934
12933
|
};
|
|
12935
12934
|
}
|
|
12936
12935
|
|
|
12937
|
-
const {abs: abs$
|
|
12936
|
+
const {abs: abs$3} = Math;
|
|
12938
12937
|
|
|
12939
12938
|
const {copy: copy$2, scale: scale$1} = MatrixHelper;
|
|
12940
12939
|
|
|
@@ -12977,7 +12976,7 @@ class Stroker extends UI {
|
|
|
12977
12976
|
leaf = list[i];
|
|
12978
12977
|
const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
|
|
12979
12978
|
if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
|
|
12980
|
-
const aScaleX = abs$
|
|
12979
|
+
const aScaleX = abs$3(worldTransform.scaleX), aScaleY = abs$3(worldTransform.scaleY);
|
|
12981
12980
|
copy$2(matrix$1, worldTransform);
|
|
12982
12981
|
matrix$1.half = strokeWidth % 2;
|
|
12983
12982
|
if (aScaleX !== aScaleY) {
|
|
@@ -12991,7 +12990,7 @@ class Stroker extends UI {
|
|
|
12991
12990
|
canvas.setWorld(matrix$1, options.matrix);
|
|
12992
12991
|
canvas.beginPath();
|
|
12993
12992
|
if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
|
|
12994
|
-
data.strokeWidth = strokeWidth / abs$
|
|
12993
|
+
data.strokeWidth = strokeWidth / abs$3(worldTransform.scaleX);
|
|
12995
12994
|
}
|
|
12996
12995
|
if (stroke) isString(stroke) ? Paint.stroke(stroke, this, canvas) : Paint.strokes(stroke, this, canvas);
|
|
12997
12996
|
if (fill) isString(fill) ? Paint.fill(fill, this, canvas) : Paint.fills(fill, this, canvas);
|
|
@@ -13285,7 +13284,7 @@ const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bot
|
|
|
13285
13284
|
|
|
13286
13285
|
const {toPoint: toPoint} = AroundHelper;
|
|
13287
13286
|
|
|
13288
|
-
const {within: within$
|
|
13287
|
+
const {within: within$3, sign: sign$1} = MathHelper;
|
|
13289
13288
|
|
|
13290
13289
|
const EditDataHelper = {
|
|
13291
13290
|
getScaleData(target, startBounds, direction, totalMove, lockRatio, around, flipable, scaleMode) {
|
|
@@ -13298,8 +13297,8 @@ const EditDataHelper = {
|
|
|
13298
13297
|
}
|
|
13299
13298
|
const originChangedScaleX = target.scaleX / startBounds.scaleX;
|
|
13300
13299
|
const originChangedScaleY = target.scaleY / startBounds.scaleY;
|
|
13301
|
-
const signX = originChangedScaleX
|
|
13302
|
-
const signY = originChangedScaleY
|
|
13300
|
+
const signX = sign$1(originChangedScaleX);
|
|
13301
|
+
const signY = sign$1(originChangedScaleY);
|
|
13303
13302
|
const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
|
|
13304
13303
|
const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
|
|
13305
13304
|
totalMove.x *= scaleMode ? originChangedScaleX : signX;
|
|
@@ -13399,14 +13398,14 @@ const EditDataHelper = {
|
|
|
13399
13398
|
}
|
|
13400
13399
|
if (useScaleX && widthRange) {
|
|
13401
13400
|
const nowWidth = boxBounds.width * target.scaleX;
|
|
13402
|
-
scaleX = within$
|
|
13401
|
+
scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
|
|
13403
13402
|
}
|
|
13404
13403
|
if (useScaleY && heightRange) {
|
|
13405
13404
|
const nowHeight = boxBounds.height * target.scaleY;
|
|
13406
|
-
scaleY = within$
|
|
13405
|
+
scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
|
|
13407
13406
|
}
|
|
13408
|
-
if (useScaleX && Math.abs(scaleX * worldBoxBounds.width) < 1) scaleX = (scaleX
|
|
13409
|
-
if (useScaleY && Math.abs(scaleY * worldBoxBounds.height) < 1) scaleY = (scaleY
|
|
13407
|
+
if (useScaleX && Math.abs(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
|
|
13408
|
+
if (useScaleY && Math.abs(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
|
|
13410
13409
|
if (lockRatio && scaleX !== scaleY) scaleY = scaleX = Math.min(scaleX, scaleY);
|
|
13411
13410
|
return {
|
|
13412
13411
|
origin: origin,
|
|
@@ -13908,7 +13907,7 @@ class EditBox extends Group {
|
|
|
13908
13907
|
if (pointType && pointType.includes("resize")) ResizeEvent.resizingKeys = editor.leafList.keys;
|
|
13909
13908
|
}
|
|
13910
13909
|
onDragEnd(e) {
|
|
13911
|
-
if (this.moving) this.transformTool.onMove(e);
|
|
13910
|
+
if (this.moving && this.mergeConfig.dragLimitAnimate && this.target.dragBounds) this.transformTool.onMove(e);
|
|
13912
13911
|
this.dragPoint = null;
|
|
13913
13912
|
this.resetDoing();
|
|
13914
13913
|
const {name: name, pointType: pointType} = e.current;
|
|
@@ -14428,9 +14427,8 @@ EditorSkewEvent.SKEW = "editor.skew";
|
|
|
14428
14427
|
|
|
14429
14428
|
class TransformTool {
|
|
14430
14429
|
onMove(e) {
|
|
14431
|
-
const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData
|
|
14430
|
+
const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
|
|
14432
14431
|
let move, {dragLimitAnimate: dragLimitAnimate} = mergeConfig;
|
|
14433
|
-
if (isUndefined(dragLimitAnimate)) dragLimitAnimate = app && app.config.pointer.dragLimitAnimate;
|
|
14434
14432
|
const isMoveEnd = e.type === MoveEvent.END || e.type === DragEvent.END;
|
|
14435
14433
|
const axisDrag = isString(target.draggable);
|
|
14436
14434
|
const checkLimitMove = !dragLimitAnimate || isMoveEnd || axisDrag;
|
|
@@ -15584,6 +15582,8 @@ const MultiTouchHelper = {
|
|
|
15584
15582
|
}
|
|
15585
15583
|
};
|
|
15586
15584
|
|
|
15585
|
+
const {abs: abs$2, max: max} = Math, {sign: sign, within: within$2} = MathHelper;
|
|
15586
|
+
|
|
15587
15587
|
const WheelEventHelper = {
|
|
15588
15588
|
getMove(event, config) {
|
|
15589
15589
|
let {moveSpeed: moveSpeed} = config;
|
|
@@ -15592,8 +15592,9 @@ const WheelEventHelper = {
|
|
|
15592
15592
|
deltaX = deltaY;
|
|
15593
15593
|
deltaY = 0;
|
|
15594
15594
|
}
|
|
15595
|
-
|
|
15596
|
-
if (
|
|
15595
|
+
const absX = abs$2(deltaX), absY = abs$2(deltaY);
|
|
15596
|
+
if (absX > 50) deltaX = max(50, absX / 3) * sign(deltaX);
|
|
15597
|
+
if (absY > 50) deltaY = max(50, absY / 3) * sign(deltaY);
|
|
15597
15598
|
return {
|
|
15598
15599
|
x: -deltaX * moveSpeed * 2,
|
|
15599
15600
|
y: -deltaY * moveSpeed * 2
|
|
@@ -15611,11 +15612,9 @@ const WheelEventHelper = {
|
|
|
15611
15612
|
zoom = !event.shiftKey && (event.metaKey || event.ctrlKey);
|
|
15612
15613
|
}
|
|
15613
15614
|
if (zoom) {
|
|
15614
|
-
zoomSpeed =
|
|
15615
|
+
zoomSpeed = within$2(zoomSpeed, 0, 1);
|
|
15615
15616
|
const min = event.deltaY ? config.delta.y : config.delta.x;
|
|
15616
|
-
scale = 1 - delta / (min * 4) * zoomSpeed;
|
|
15617
|
-
if (scale < .5) scale = .5;
|
|
15618
|
-
if (scale >= 1.5) scale = 1.5;
|
|
15617
|
+
scale = within$2(1 - delta / (min * 4) * zoomSpeed, .5, 1.5);
|
|
15619
15618
|
}
|
|
15620
15619
|
return scale;
|
|
15621
15620
|
}
|