@leafer-draw/miniapp 1.9.9 → 1.9.10
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.cjs +28 -17
- package/dist/miniapp.esm.js +28 -17
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +76 -133
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +9 -9
package/dist/miniapp.module.js
CHANGED
|
@@ -263,7 +263,7 @@ const FourNumberHelper = {
|
|
|
263
263
|
return to;
|
|
264
264
|
},
|
|
265
265
|
setTemp(top, right, bottom, left) {
|
|
266
|
-
return set$
|
|
266
|
+
return set$2(tempFour, top, right, bottom, left);
|
|
267
267
|
},
|
|
268
268
|
toTempAB(a, b, change) {
|
|
269
269
|
tempTo = change ? isNumber(a) ? b : a : [];
|
|
@@ -303,22 +303,22 @@ const FourNumberHelper = {
|
|
|
303
303
|
max(t, other, change) {
|
|
304
304
|
if (isNumber(t) && isNumber(other)) return max$4(t, other);
|
|
305
305
|
toTempAB(t, other, change);
|
|
306
|
-
return set$
|
|
306
|
+
return set$2(tempTo, max$4(tempA[0], tempB[0]), max$4(tempA[1], tempB[1]), max$4(tempA[2], tempB[2]), max$4(tempA[3], tempB[3]));
|
|
307
307
|
},
|
|
308
308
|
add(t, other, change) {
|
|
309
309
|
if (isNumber(t) && isNumber(other)) return t + other;
|
|
310
310
|
toTempAB(t, other, change);
|
|
311
|
-
return set$
|
|
311
|
+
return set$2(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
|
|
312
312
|
},
|
|
313
313
|
swapAndScale(t, scaleX, scaleY, change) {
|
|
314
314
|
if (isNumber(t)) return scaleX === scaleY ? t * scaleX : [ t * scaleY, t * scaleX ];
|
|
315
315
|
const to = change ? t : [];
|
|
316
316
|
const [top, right, bottom, left] = t.length === 4 ? t : get$5(t);
|
|
317
|
-
return set$
|
|
317
|
+
return set$2(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
320
|
|
|
321
|
-
const {set: set$
|
|
321
|
+
const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
|
|
322
322
|
|
|
323
323
|
const {round: round$3, pow: pow$1, PI: PI$3} = Math;
|
|
324
324
|
|
|
@@ -418,7 +418,7 @@ function getMatrixData() {
|
|
|
418
418
|
|
|
419
419
|
const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
420
420
|
|
|
421
|
-
const {float: float$
|
|
421
|
+
const {float: float$1} = MathHelper;
|
|
422
422
|
|
|
423
423
|
const tempPoint$3 = {};
|
|
424
424
|
|
|
@@ -669,12 +669,12 @@ const MatrixHelper = {
|
|
|
669
669
|
const cosR = c / scaleY;
|
|
670
670
|
rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
|
|
671
671
|
}
|
|
672
|
-
const cosR = float$
|
|
672
|
+
const cosR = float$1(cos$5(rotation));
|
|
673
673
|
const sinR = sin$5(rotation);
|
|
674
|
-
scaleX = float$
|
|
675
|
-
skewX = cosR ? float$
|
|
676
|
-
skewY = cosR ? float$
|
|
677
|
-
rotation = float$
|
|
674
|
+
scaleX = float$1(scaleX), scaleY = float$1(scaleY);
|
|
675
|
+
skewX = cosR ? float$1((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
|
|
676
|
+
skewY = cosR ? float$1((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
|
|
677
|
+
rotation = float$1(rotation / OneRadian);
|
|
678
678
|
} else {
|
|
679
679
|
scaleX = a;
|
|
680
680
|
scaleY = d;
|
|
@@ -720,7 +720,7 @@ const M$6 = MatrixHelper;
|
|
|
720
720
|
|
|
721
721
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
722
722
|
|
|
723
|
-
const {sin: sin$4, cos: cos$4, abs: abs$
|
|
723
|
+
const {sin: sin$4, cos: cos$4, abs: abs$4, sqrt: sqrt$2, atan2: atan2$2, min: min$1, round: round$2} = Math;
|
|
724
724
|
|
|
725
725
|
const PointHelper = {
|
|
726
726
|
defaultPoint: getPointData(),
|
|
@@ -813,8 +813,8 @@ const PointHelper = {
|
|
|
813
813
|
return getDistanceFrom(t.x, t.y, point.x, point.y);
|
|
814
814
|
},
|
|
815
815
|
getDistanceFrom(x1, y1, x2, y2) {
|
|
816
|
-
const x = abs$
|
|
817
|
-
const y = abs$
|
|
816
|
+
const x = abs$4(x2 - x1);
|
|
817
|
+
const y = abs$4(y2 - y1);
|
|
818
818
|
return sqrt$2(x * x + y * y);
|
|
819
819
|
},
|
|
820
820
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
@@ -1200,7 +1200,7 @@ const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$2, addPoint: addPo
|
|
|
1200
1200
|
|
|
1201
1201
|
const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
|
|
1202
1202
|
|
|
1203
|
-
const {float: float
|
|
1203
|
+
const {float: float, fourNumber: fourNumber} = MathHelper;
|
|
1204
1204
|
|
|
1205
1205
|
const {floor: floor$2, ceil: ceil$2} = Math;
|
|
1206
1206
|
|
|
@@ -1375,10 +1375,10 @@ const BoundsHelper = {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
},
|
|
1377
1377
|
float(t, maxLength) {
|
|
1378
|
-
t.x = float
|
|
1379
|
-
t.y = float
|
|
1380
|
-
t.width = float
|
|
1381
|
-
t.height = float
|
|
1378
|
+
t.x = float(t.x, maxLength);
|
|
1379
|
+
t.y = float(t.y, maxLength);
|
|
1380
|
+
t.width = float(t.width, maxLength);
|
|
1381
|
+
t.height = float(t.height, maxLength);
|
|
1382
1382
|
},
|
|
1383
1383
|
add(t, bounds, isPoint) {
|
|
1384
1384
|
right$1 = t.x + t.width;
|
|
@@ -1714,17 +1714,17 @@ class Debug {
|
|
|
1714
1714
|
showHit ? canvas.stroke() : canvas.strokeWorld(w, color);
|
|
1715
1715
|
}
|
|
1716
1716
|
log(...messages) {
|
|
1717
|
-
if (D$
|
|
1718
|
-
if (D$
|
|
1719
|
-
if (D$
|
|
1717
|
+
if (D$4.enable) {
|
|
1718
|
+
if (D$4.filterList.length && D$4.filterList.every(name => name !== this.name)) return;
|
|
1719
|
+
if (D$4.excludeList.length && D$4.excludeList.some(name => name === this.name)) return;
|
|
1720
1720
|
console.log("%c" + this.name, "color:#21ae62", ...messages);
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
1723
|
tip(...messages) {
|
|
1724
|
-
if (D$
|
|
1724
|
+
if (D$4.enable) this.warn(...messages);
|
|
1725
1725
|
}
|
|
1726
1726
|
warn(...messages) {
|
|
1727
|
-
if (D$
|
|
1727
|
+
if (D$4.showWarn) console.warn(this.name, ...messages);
|
|
1728
1728
|
}
|
|
1729
1729
|
repeat(name, ...messages) {
|
|
1730
1730
|
if (!this.repeatMap[name]) {
|
|
@@ -1752,7 +1752,7 @@ function getNameList(name) {
|
|
|
1752
1752
|
return name;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
|
-
const D$
|
|
1755
|
+
const D$4 = Debug;
|
|
1756
1756
|
|
|
1757
1757
|
const debug$e = Debug.get("RunTime");
|
|
1758
1758
|
|
|
@@ -2592,11 +2592,11 @@ const RectHelper = {
|
|
|
2592
2592
|
}
|
|
2593
2593
|
};
|
|
2594
2594
|
|
|
2595
|
-
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil$1, abs: abs$
|
|
2595
|
+
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow: pow} = Math;
|
|
2596
2596
|
|
|
2597
2597
|
const {setPoint: setPoint$1, addPoint: addPoint$1} = TwoPointBoundsHelper;
|
|
2598
2598
|
|
|
2599
|
-
const {set: set, toNumberPoints: toNumberPoints} = PointHelper;
|
|
2599
|
+
const {set: set$1, toNumberPoints: toNumberPoints} = PointHelper;
|
|
2600
2600
|
|
|
2601
2601
|
const {M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5} = PathCommandMap;
|
|
2602
2602
|
|
|
@@ -2667,14 +2667,14 @@ const BezierHelper = {
|
|
|
2667
2667
|
const lenCB = hypot(CBx, CBy);
|
|
2668
2668
|
let totalRadian = endRadian - startRadian;
|
|
2669
2669
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2670
|
-
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$
|
|
2670
|
+
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$3(totalRadian - PI$2) < 1e-12) {
|
|
2671
2671
|
if (data) data.push(L$6, x1, y1);
|
|
2672
2672
|
if (setPointBounds) {
|
|
2673
2673
|
setPoint$1(setPointBounds, fromX, fromY);
|
|
2674
2674
|
addPoint$1(setPointBounds, x1, y1);
|
|
2675
2675
|
}
|
|
2676
|
-
if (setStartPoint) set(setStartPoint, fromX, fromY);
|
|
2677
|
-
if (setEndPoint) set(setEndPoint, x1, y1);
|
|
2676
|
+
if (setStartPoint) set$1(setStartPoint, fromX, fromY);
|
|
2677
|
+
if (setEndPoint) set$1(setEndPoint, x1, y1);
|
|
2678
2678
|
return;
|
|
2679
2679
|
}
|
|
2680
2680
|
const anticlockwise = BAx * CBy - CBx * BAy < 0;
|
|
@@ -2700,7 +2700,7 @@ const BezierHelper = {
|
|
|
2700
2700
|
let totalRadian = endRadian - startRadian;
|
|
2701
2701
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2702
2702
|
if (anticlockwise) totalRadian -= PI2;
|
|
2703
|
-
const parts = ceil$1(abs$
|
|
2703
|
+
const parts = ceil$1(abs$3(totalRadian / PI_2));
|
|
2704
2704
|
const partRadian = totalRadian / parts;
|
|
2705
2705
|
const partRadian4Sin = sin$3(partRadian / 4);
|
|
2706
2706
|
const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$3(partRadian / 2);
|
|
@@ -2714,7 +2714,7 @@ const BezierHelper = {
|
|
|
2714
2714
|
let fromX = cx + x, fromY = cy + y;
|
|
2715
2715
|
if (data) data.push(data.length ? L$6 : M$5, fromX, fromY);
|
|
2716
2716
|
if (setPointBounds) setPoint$1(setPointBounds, fromX, fromY);
|
|
2717
|
-
if (setStartPoint) set(setStartPoint, fromX, fromY);
|
|
2717
|
+
if (setStartPoint) set$1(setStartPoint, fromX, fromY);
|
|
2718
2718
|
for (let i = 0; i < parts; i++) {
|
|
2719
2719
|
endCos = cos$3(endRadian);
|
|
2720
2720
|
endSin = sin$3(endRadian);
|
|
@@ -2733,7 +2733,7 @@ const BezierHelper = {
|
|
|
2733
2733
|
startRadian = endRadian;
|
|
2734
2734
|
endRadian += partRadian;
|
|
2735
2735
|
}
|
|
2736
|
-
if (setEndPoint) set(setEndPoint, cx + x, cy + y);
|
|
2736
|
+
if (setEndPoint) set$1(setEndPoint, cx + x, cy + y);
|
|
2737
2737
|
},
|
|
2738
2738
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2739
2739
|
data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
@@ -2842,7 +2842,7 @@ const EllipseHelper = {
|
|
|
2842
2842
|
}
|
|
2843
2843
|
};
|
|
2844
2844
|
|
|
2845
|
-
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$
|
|
2845
|
+
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2846
2846
|
|
|
2847
2847
|
const {rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2848
2848
|
|
|
@@ -3062,7 +3062,7 @@ const PathConvert = {
|
|
|
3062
3062
|
i += 5;
|
|
3063
3063
|
break;
|
|
3064
3064
|
|
|
3065
|
-
case D$
|
|
3065
|
+
case D$3:
|
|
3066
3066
|
x = old[i + 1];
|
|
3067
3067
|
y = old[i + 2];
|
|
3068
3068
|
curveMode ? roundRect$2(data, x, y, old[i + 3], old[i + 4], [ old[i + 5], old[i + 6], old[i + 7], old[i + 8] ]) : copyData(data, old, i, 9);
|
|
@@ -3163,11 +3163,11 @@ const PathConvert = {
|
|
|
3163
3163
|
|
|
3164
3164
|
const {current: current, pushData: pushData, copyData: copyData} = PathConvert;
|
|
3165
3165
|
|
|
3166
|
-
const {M: M$3, L: L$4, C: C$2, Q: Q$2, Z: Z$3, N: N$2, D: D$
|
|
3166
|
+
const {M: M$3, L: L$4, C: C$2, Q: Q$2, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F: F$3, O: O$2, P: P$2, U: U$2} = PathCommandMap;
|
|
3167
3167
|
|
|
3168
3168
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3169
3169
|
|
|
3170
|
-
const {tan: tan, min: min, abs: abs$
|
|
3170
|
+
const {tan: tan, min: min, abs: abs$2} = Math;
|
|
3171
3171
|
|
|
3172
3172
|
const startPoint = {};
|
|
3173
3173
|
|
|
@@ -3199,7 +3199,7 @@ const PathCommandDataHelper = {
|
|
|
3199
3199
|
} else {
|
|
3200
3200
|
const fourCorners = MathHelper.fourNumber(cornerRadius);
|
|
3201
3201
|
if (fourCorners) {
|
|
3202
|
-
data.push(D$
|
|
3202
|
+
data.push(D$2, x, y, width, height, ...fourCorners);
|
|
3203
3203
|
} else {
|
|
3204
3204
|
data.push(N$2, x, y, width, height);
|
|
3205
3205
|
}
|
|
@@ -3225,7 +3225,7 @@ const PathCommandDataHelper = {
|
|
|
3225
3225
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
|
|
3226
3226
|
if (!isUndefined(lastX)) {
|
|
3227
3227
|
const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
|
|
3228
|
-
radius = min(radius, min(d / 2, d / 2 * abs$
|
|
3228
|
+
radius = min(radius, min(d / 2, d / 2 * abs$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3229
3229
|
}
|
|
3230
3230
|
data.push(U$2, x1, y1, x2, y2, radius);
|
|
3231
3231
|
},
|
|
@@ -3338,7 +3338,7 @@ class PathCreator {
|
|
|
3338
3338
|
paint() {}
|
|
3339
3339
|
}
|
|
3340
3340
|
|
|
3341
|
-
const {M: M$2, L: L$3, C: C$1, Q: Q$1, Z: Z$2, N: N$1, D: D$
|
|
3341
|
+
const {M: M$2, L: L$3, C: C$1, Q: Q$1, Z: Z$2, N: N$1, D: D$1, X: X$1, G: G$1, F: F$2, O: O$1, P: P$1, U: U$1} = PathCommandMap;
|
|
3342
3342
|
|
|
3343
3343
|
const debug$a = Debug.get("PathDrawer");
|
|
3344
3344
|
|
|
@@ -3380,7 +3380,7 @@ const PathDrawer = {
|
|
|
3380
3380
|
i += 5;
|
|
3381
3381
|
break;
|
|
3382
3382
|
|
|
3383
|
-
case D$
|
|
3383
|
+
case D$1:
|
|
3384
3384
|
drawer.roundRect(data[i + 1], data[i + 2], data[i + 3], data[i + 4], [ data[i + 5], data[i + 6], data[i + 7], data[i + 8] ]);
|
|
3385
3385
|
i += 9;
|
|
3386
3386
|
break;
|
|
@@ -3423,7 +3423,7 @@ const PathDrawer = {
|
|
|
3423
3423
|
}
|
|
3424
3424
|
};
|
|
3425
3425
|
|
|
3426
|
-
const {M: M$1, L: L$2, C: C, Q: Q, Z: Z$1, N: N, D: D
|
|
3426
|
+
const {M: M$1, L: L$2, C: C, Q: Q, Z: Z$1, N: N, D: D, X: X, G: G, F: F$1, O: O, P: P, U: U} = PathCommandMap;
|
|
3427
3427
|
|
|
3428
3428
|
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
|
|
3429
3429
|
|
|
@@ -3499,12 +3499,12 @@ const PathBounds = {
|
|
|
3499
3499
|
i += 5;
|
|
3500
3500
|
break;
|
|
3501
3501
|
|
|
3502
|
-
case D
|
|
3502
|
+
case D:
|
|
3503
3503
|
case X:
|
|
3504
3504
|
x = data[i + 1];
|
|
3505
3505
|
y = data[i + 2];
|
|
3506
3506
|
addBounds(setPointBounds, x, y, data[i + 3], data[i + 4]);
|
|
3507
|
-
i += command === D
|
|
3507
|
+
i += command === D ? 9 : 6;
|
|
3508
3508
|
break;
|
|
3509
3509
|
|
|
3510
3510
|
case G:
|
|
@@ -6815,7 +6815,7 @@ class LeafLevelList {
|
|
|
6815
6815
|
}
|
|
6816
6816
|
}
|
|
6817
6817
|
|
|
6818
|
-
const version = "1.9.
|
|
6818
|
+
const version = "1.9.10";
|
|
6819
6819
|
|
|
6820
6820
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6821
6821
|
get allowBackgroundColor() {
|
|
@@ -8003,12 +8003,12 @@ class ImageData extends RectData {
|
|
|
8003
8003
|
}
|
|
8004
8004
|
__getData() {
|
|
8005
8005
|
const data = super.__getData();
|
|
8006
|
-
delete data.fill;
|
|
8006
|
+
if (data.url) delete data.fill;
|
|
8007
8007
|
return data;
|
|
8008
8008
|
}
|
|
8009
8009
|
__getInputData(names, options) {
|
|
8010
8010
|
const data = super.__getInputData(names, options);
|
|
8011
|
-
delete data.fill;
|
|
8011
|
+
if (data.url) delete data.fill;
|
|
8012
8012
|
return data;
|
|
8013
8013
|
}
|
|
8014
8014
|
}
|
|
@@ -8065,74 +8065,6 @@ const UIBounds = {
|
|
|
8065
8065
|
}
|
|
8066
8066
|
};
|
|
8067
8067
|
|
|
8068
|
-
const {float: float} = MathHelper;
|
|
8069
|
-
|
|
8070
|
-
const tempContent = new Bounds, tempMerge = new Bounds, tempIntersect = new Bounds;
|
|
8071
|
-
|
|
8072
|
-
const DragBoundsHelper = {
|
|
8073
|
-
limitMove(leaf, move) {
|
|
8074
|
-
const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
|
|
8075
|
-
if (dragBounds) D.getValidMove(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, move, true);
|
|
8076
|
-
D.axisMove(leaf, move);
|
|
8077
|
-
},
|
|
8078
|
-
limitScaleOf(leaf, origin, scale) {
|
|
8079
|
-
const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
|
|
8080
|
-
if (dragBounds) D.getValidScaleOf(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, leaf.getLocalPointByInner(leaf.getInnerPointByBox(origin)), scale, true);
|
|
8081
|
-
},
|
|
8082
|
-
axisMove(leaf, move) {
|
|
8083
|
-
const {draggable: draggable} = leaf;
|
|
8084
|
-
if (draggable === "x") move.y = 0;
|
|
8085
|
-
if (draggable === "y") move.x = 0;
|
|
8086
|
-
},
|
|
8087
|
-
getDragBounds(leaf) {
|
|
8088
|
-
const {dragBounds: dragBounds} = leaf;
|
|
8089
|
-
return dragBounds === "parent" ? leaf.parent.boxBounds : dragBounds;
|
|
8090
|
-
},
|
|
8091
|
-
isInnerMode(content, dragBounds, dragBoundsType, sideType) {
|
|
8092
|
-
return dragBoundsType === "inner" || dragBoundsType === "auto" && content[sideType] > dragBounds[sideType];
|
|
8093
|
-
},
|
|
8094
|
-
getValidMove(content, dragBounds, dragBoundsType, move, change) {
|
|
8095
|
-
const x = content.x + move.x, y = content.y + move.y, right = x + content.width, bottom = y + content.height;
|
|
8096
|
-
const boundsRight = dragBounds.x + dragBounds.width, boundsBottom = dragBounds.y + dragBounds.height;
|
|
8097
|
-
if (!change) move = Object.assign({}, move);
|
|
8098
|
-
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
8099
|
-
if (x > dragBounds.x) move.x += dragBounds.x - x; else if (right < boundsRight) move.x += boundsRight - right;
|
|
8100
|
-
} else {
|
|
8101
|
-
if (x < dragBounds.x) move.x += dragBounds.x - x; else if (right > boundsRight) move.x += boundsRight - right;
|
|
8102
|
-
}
|
|
8103
|
-
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
8104
|
-
if (y > dragBounds.y) move.y += dragBounds.y - y; else if (bottom < boundsBottom) move.y += boundsBottom - bottom;
|
|
8105
|
-
} else {
|
|
8106
|
-
if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
|
|
8107
|
-
}
|
|
8108
|
-
move.x = float(move.x);
|
|
8109
|
-
move.y = float(move.y);
|
|
8110
|
-
return move;
|
|
8111
|
-
},
|
|
8112
|
-
getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, change) {
|
|
8113
|
-
if (!change) scale = Object.assign({}, scale);
|
|
8114
|
-
let fitScaleX, fitScaleY;
|
|
8115
|
-
tempContent.set(content).scaleOf(origin, scale.x, scale.y).unsign();
|
|
8116
|
-
tempMerge.set(tempContent).add(dragBounds);
|
|
8117
|
-
tempIntersect.set(tempContent).intersect(dragBounds);
|
|
8118
|
-
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
8119
|
-
fitScaleX = tempMerge.width / tempContent.width;
|
|
8120
|
-
} else {
|
|
8121
|
-
fitScaleX = tempIntersect.width / tempContent.width;
|
|
8122
|
-
}
|
|
8123
|
-
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
8124
|
-
fitScaleY = tempMerge.height / tempContent.height;
|
|
8125
|
-
} else {
|
|
8126
|
-
fitScaleY = tempIntersect.height / tempContent.height;
|
|
8127
|
-
}
|
|
8128
|
-
scale.x = float(tempIntersect.width) ? scale.x * fitScaleX : 1;
|
|
8129
|
-
scale.y = float(tempIntersect.height) ? scale.y * fitScaleY : 1;
|
|
8130
|
-
return scale;
|
|
8131
|
-
}
|
|
8132
|
-
};
|
|
8133
|
-
|
|
8134
|
-
const D = DragBoundsHelper;
|
|
8135
|
-
|
|
8136
8068
|
const {stintSet: stintSet$1} = DataHelper;
|
|
8137
8069
|
|
|
8138
8070
|
const UIRender = {
|
|
@@ -9953,7 +9885,14 @@ const PaintModule = {
|
|
|
9953
9885
|
|
|
9954
9886
|
let origin = {}, tempMatrix$1 = getMatrixData();
|
|
9955
9887
|
|
|
9956
|
-
const {get: get$3, rotateOfOuter: rotateOfOuter$1, translate: translate$1, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate, skew: skewHelper} = MatrixHelper;
|
|
9888
|
+
const {get: get$3, set: set, rotateOfOuter: rotateOfOuter$1, translate: translate$1, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate, skew: skewHelper} = MatrixHelper;
|
|
9889
|
+
|
|
9890
|
+
function stretchMode(data, box, scaleX, scaleY) {
|
|
9891
|
+
const transform = get$3();
|
|
9892
|
+
translate$1(transform, box.x, box.y);
|
|
9893
|
+
if (scaleX) scaleHelper(transform, scaleX, scaleY);
|
|
9894
|
+
data.transform = transform;
|
|
9895
|
+
}
|
|
9957
9896
|
|
|
9958
9897
|
function fillOrFitMode(data, box, x, y, scaleX, scaleY, rotation) {
|
|
9959
9898
|
const transform = get$3();
|
|
@@ -9970,8 +9909,11 @@ function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew, clipScaleX, c
|
|
|
9970
9909
|
const transform = get$3();
|
|
9971
9910
|
layout(transform, box, x, y, scaleX, scaleY, rotation, skew);
|
|
9972
9911
|
if (clipScaleX) {
|
|
9973
|
-
|
|
9974
|
-
|
|
9912
|
+
if (rotation || skew) {
|
|
9913
|
+
set(tempMatrix$1);
|
|
9914
|
+
scaleOfOuter$1(tempMatrix$1, box, clipScaleX, clipScaleY);
|
|
9915
|
+
multiplyParent(transform, tempMatrix$1);
|
|
9916
|
+
} else scaleOfOuter$1(transform, box, clipScaleX, clipScaleY);
|
|
9975
9917
|
}
|
|
9976
9918
|
data.transform = transform;
|
|
9977
9919
|
}
|
|
@@ -10067,7 +10009,10 @@ function getPatternData(paint, box, image) {
|
|
|
10067
10009
|
if (offset) PointHelper.move(tempImage, offset);
|
|
10068
10010
|
switch (mode) {
|
|
10069
10011
|
case "stretch":
|
|
10070
|
-
if (!sameBox)
|
|
10012
|
+
if (!sameBox) {
|
|
10013
|
+
scaleX = box.width / width, scaleY = box.height / height;
|
|
10014
|
+
stretchMode(data, box, scaleX, scaleY);
|
|
10015
|
+
}
|
|
10071
10016
|
break;
|
|
10072
10017
|
|
|
10073
10018
|
case "normal":
|
|
@@ -10076,7 +10021,7 @@ function getPatternData(paint, box, image) {
|
|
|
10076
10021
|
let clipScaleX, clipScaleY;
|
|
10077
10022
|
if (clipSize) clipScaleX = box.width / clipSize.width, clipScaleY = box.height / clipSize.height;
|
|
10078
10023
|
clipMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, clipScaleX, clipScaleY);
|
|
10079
|
-
if (clipScaleX) scaleX = scaleX ? scaleX * clipScaleX :
|
|
10024
|
+
if (clipScaleX) scaleX = scaleX ? scaleX * clipScaleX : clipScaleX, scaleY = scaleY ? scaleY * clipScaleY : clipScaleY;
|
|
10080
10025
|
}
|
|
10081
10026
|
break;
|
|
10082
10027
|
|
|
@@ -10093,17 +10038,14 @@ function getPatternData(paint, box, image) {
|
|
|
10093
10038
|
if (scaleX) fillOrFitMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation);
|
|
10094
10039
|
}
|
|
10095
10040
|
if (!data.transform) {
|
|
10096
|
-
if (box.x || box.y)
|
|
10097
|
-
data.transform = get$2();
|
|
10098
|
-
translate(data.transform, box.x, box.y);
|
|
10099
|
-
}
|
|
10041
|
+
if (box.x || box.y) translate(data.transform = get$2(), box.x, box.y);
|
|
10100
10042
|
}
|
|
10101
|
-
|
|
10043
|
+
data.width = width;
|
|
10044
|
+
data.height = height;
|
|
10045
|
+
if (scaleX) {
|
|
10102
10046
|
data.scaleX = scaleX;
|
|
10103
10047
|
data.scaleY = scaleY;
|
|
10104
10048
|
}
|
|
10105
|
-
data.width = width;
|
|
10106
|
-
data.height = height;
|
|
10107
10049
|
if (opacity) data.opacity = opacity;
|
|
10108
10050
|
if (filters) data.filters = filters;
|
|
10109
10051
|
if (repeat) data.repeat = isString(repeat) ? repeat === "x" ? "repeat-x" : "repeat-y" : "repeat";
|
|
@@ -10235,7 +10177,7 @@ function ignoreRender(ui, value) {
|
|
|
10235
10177
|
|
|
10236
10178
|
const {get: get$1, scale: scale, copy: copy$1} = MatrixHelper;
|
|
10237
10179
|
|
|
10238
|
-
const {floor: floor, ceil: ceil, max: max$1, abs: abs} = Math;
|
|
10180
|
+
const {floor: floor, ceil: ceil, max: max$1, abs: abs$1} = Math;
|
|
10239
10181
|
|
|
10240
10182
|
function createPattern(ui, paint, pixelRatio) {
|
|
10241
10183
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, paint.scaleFixed);
|
|
@@ -10246,8 +10188,8 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
10246
10188
|
scaleX *= pixelRatio;
|
|
10247
10189
|
scaleY *= pixelRatio;
|
|
10248
10190
|
if (sx) {
|
|
10249
|
-
sx = abs(sx);
|
|
10250
|
-
sy = abs(sy);
|
|
10191
|
+
sx = abs$1(sx);
|
|
10192
|
+
sy = abs$1(sy);
|
|
10251
10193
|
imageMatrix = get$1();
|
|
10252
10194
|
copy$1(imageMatrix, transform);
|
|
10253
10195
|
scale(imageMatrix, 1 / sx, 1 / sy);
|
|
@@ -10389,6 +10331,7 @@ const PaintImageModule = {
|
|
|
10389
10331
|
recycleImage: recycleImage,
|
|
10390
10332
|
createData: createData,
|
|
10391
10333
|
getPatternData: getPatternData,
|
|
10334
|
+
stretchMode: stretchMode,
|
|
10392
10335
|
fillOrFitMode: fillOrFitMode,
|
|
10393
10336
|
clipMode: clipMode,
|
|
10394
10337
|
repeatMode: repeatMode
|
|
@@ -10499,7 +10442,7 @@ const PaintGradientModule = {
|
|
|
10499
10442
|
getTransform: getTransform
|
|
10500
10443
|
};
|
|
10501
10444
|
|
|
10502
|
-
const {copy: copy, move: move, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max} = Math;
|
|
10445
|
+
const {copy: copy, move: move, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max, abs: abs} = Math;
|
|
10503
10446
|
|
|
10504
10447
|
const tempBounds = {}, tempMatrix = new Matrix;
|
|
10505
10448
|
|
|
@@ -10543,7 +10486,7 @@ function shadow(ui, current, shape) {
|
|
|
10543
10486
|
function getShadowRenderSpread(_ui, shadow) {
|
|
10544
10487
|
let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
|
|
10545
10488
|
shadow.forEach(item => {
|
|
10546
|
-
x = item.x || 0, y = item.y || 0,
|
|
10489
|
+
x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs(item.spread || 0);
|
|
10547
10490
|
top = max(top, spread + blur - y);
|
|
10548
10491
|
right = max(right, spread + blur + x);
|
|
10549
10492
|
bottom = max(bottom, spread + blur + y);
|
|
@@ -11264,4 +11207,4 @@ try {
|
|
|
11264
11207
|
if (wx) useCanvas("miniapp", wx);
|
|
11265
11208
|
} catch (_a) {}
|
|
11266
11209
|
|
|
11267
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9,
|
|
11210
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, 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, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|