@leafer-ui/miniapp 1.5.0 → 1.5.2
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 +31 -12
- package/dist/miniapp.cjs.map +1 -1
- package/dist/miniapp.esm.js +31 -12
- package/dist/miniapp.esm.js.map +1 -1
- 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 +109 -58
- package/dist/miniapp.module.js.map +1 -1
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/miniapp.module.js
CHANGED
|
@@ -116,8 +116,9 @@ const MathHelper = {
|
|
|
116
116
|
if (!scaleData)
|
|
117
117
|
scaleData = {};
|
|
118
118
|
if (size) {
|
|
119
|
-
|
|
120
|
-
scaleData.
|
|
119
|
+
const scaleX = (typeof size === 'number' ? size : size.width || 0) / originSize.width, scaleY = (typeof size === 'number' ? size : size.height || 0) / originSize.height;
|
|
120
|
+
scaleData.scaleX = scaleX || scaleY || 1;
|
|
121
|
+
scaleData.scaleY = scaleY || scaleX || 1;
|
|
121
122
|
}
|
|
122
123
|
else if (scale)
|
|
123
124
|
MathHelper.assignScale(scaleData, scale);
|
|
@@ -1690,6 +1691,9 @@ const emptyData = {};
|
|
|
1690
1691
|
function isNull(value) {
|
|
1691
1692
|
return value === undefined || value === null;
|
|
1692
1693
|
}
|
|
1694
|
+
function isEmptyData(value) {
|
|
1695
|
+
return JSON.stringify(value) === '{}';
|
|
1696
|
+
}
|
|
1693
1697
|
|
|
1694
1698
|
/******************************************************************************
|
|
1695
1699
|
Copyright (c) Microsoft Corporation.
|
|
@@ -2029,13 +2033,11 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2029
2033
|
this.worldTransform = {};
|
|
2030
2034
|
if (!config)
|
|
2031
2035
|
config = minSize;
|
|
2032
|
-
if (!config.pixelRatio)
|
|
2033
|
-
config.pixelRatio = Platform.devicePixelRatio;
|
|
2034
2036
|
this.manager = manager;
|
|
2035
2037
|
this.innerId = IncrementId.create(IncrementId.CNAVAS);
|
|
2036
2038
|
const { width, height, pixelRatio } = config;
|
|
2037
2039
|
this.autoLayout = !width || !height;
|
|
2038
|
-
this.size.pixelRatio = pixelRatio;
|
|
2040
|
+
this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio;
|
|
2039
2041
|
this.config = config;
|
|
2040
2042
|
this.init();
|
|
2041
2043
|
}
|
|
@@ -2232,7 +2234,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2232
2234
|
tempBounds$1.ceil();
|
|
2233
2235
|
}
|
|
2234
2236
|
isSameSize(size) {
|
|
2235
|
-
return this.width === size.width && this.height === size.height && this.pixelRatio === size.pixelRatio;
|
|
2237
|
+
return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
|
|
2236
2238
|
}
|
|
2237
2239
|
getSameCanvas(useSameWorldTransform, useSameSmooth) {
|
|
2238
2240
|
const canvas = this.manager ? this.manager.get(this.size) : Creator.canvas(Object.assign({}, this.size));
|
|
@@ -2347,7 +2349,7 @@ const RectHelper = {
|
|
|
2347
2349
|
const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
|
|
2348
2350
|
const { setPoint: setPoint$1, addPoint: addPoint$1 } = TwoPointBoundsHelper;
|
|
2349
2351
|
const { set, toNumberPoints } = PointHelper;
|
|
2350
|
-
const { M: M$5, L: L$6, C: C$
|
|
2352
|
+
const { M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5 } = PathCommandMap;
|
|
2351
2353
|
const tempPoint$2 = {};
|
|
2352
2354
|
const BezierHelper = {
|
|
2353
2355
|
points(data, originPoints, curve, close) {
|
|
@@ -2382,7 +2384,7 @@ const BezierHelper = {
|
|
|
2382
2384
|
data.push(Q$4, c1X, c1Y, bX, bY);
|
|
2383
2385
|
}
|
|
2384
2386
|
else {
|
|
2385
|
-
data.push(C$
|
|
2387
|
+
data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2386
2388
|
}
|
|
2387
2389
|
c2X = bX + cb * cX;
|
|
2388
2390
|
c2Y = bY + cb * cY;
|
|
@@ -2487,7 +2489,7 @@ const BezierHelper = {
|
|
|
2487
2489
|
x2 = cx + x + control * (rotationCos * radiusX * endSin + rotationSin * radiusY * endCos);
|
|
2488
2490
|
y2 = cy + y + control * (rotationSin * radiusX * endSin - rotationCos * radiusY * endCos);
|
|
2489
2491
|
if (data)
|
|
2490
|
-
data.push(C$
|
|
2492
|
+
data.push(C$4, x1, y1, x2, y2, cx + x, cy + y);
|
|
2491
2493
|
if (setPointBounds)
|
|
2492
2494
|
toTwoPointBounds$1(cx + startX, cy + startY, x1, y1, x2, y2, cx + x, cy + y, setPointBounds, true);
|
|
2493
2495
|
startX = x;
|
|
@@ -2501,7 +2503,7 @@ const BezierHelper = {
|
|
|
2501
2503
|
set(setEndPoint, cx + x, cy + y);
|
|
2502
2504
|
},
|
|
2503
2505
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2504
|
-
data.push(C$
|
|
2506
|
+
data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
2505
2507
|
},
|
|
2506
2508
|
toTwoPointBoundsByQuadraticCurve(fromX, fromY, x1, y1, toX, toY, pointBounds, addMode) {
|
|
2507
2509
|
toTwoPointBounds$1(fromX, fromY, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY, pointBounds, addMode);
|
|
@@ -2609,7 +2611,7 @@ const EllipseHelper = {
|
|
|
2609
2611
|
}
|
|
2610
2612
|
};
|
|
2611
2613
|
|
|
2612
|
-
const { M: M$4, m, L: L$5, l, H, h, V, v, C: C$
|
|
2614
|
+
const { M: M$4, m, L: L$5, l, H, h, V, v, C: C$3, c, S, s, Q: Q$3, q, T, t, A, a, Z: Z$4, 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;
|
|
2613
2615
|
const { rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
|
|
2614
2616
|
const { ellipticalArc } = EllipseHelper;
|
|
2615
2617
|
const debug$c = Debug.get('PathConvert');
|
|
@@ -2737,14 +2739,14 @@ const PathConvert = {
|
|
|
2737
2739
|
old[i + 4] += y;
|
|
2738
2740
|
command = S;
|
|
2739
2741
|
case S:
|
|
2740
|
-
smooth = (lastCommand === C$
|
|
2742
|
+
smooth = (lastCommand === C$3) || (lastCommand === S);
|
|
2741
2743
|
x1 = smooth ? (x * 2 - controlX) : old[i + 1];
|
|
2742
2744
|
y1 = smooth ? (y * 2 - controlY) : old[i + 2];
|
|
2743
2745
|
controlX = old[i + 1];
|
|
2744
2746
|
controlY = old[i + 2];
|
|
2745
2747
|
x = old[i + 3];
|
|
2746
2748
|
y = old[i + 4];
|
|
2747
|
-
data.push(C$
|
|
2749
|
+
data.push(C$3, x1, y1, controlX, controlY, x, y);
|
|
2748
2750
|
i += 5;
|
|
2749
2751
|
break;
|
|
2750
2752
|
case c:
|
|
@@ -2754,13 +2756,13 @@ const PathConvert = {
|
|
|
2754
2756
|
old[i + 4] += y;
|
|
2755
2757
|
old[i + 5] += x;
|
|
2756
2758
|
old[i + 6] += y;
|
|
2757
|
-
command = C$
|
|
2758
|
-
case C$
|
|
2759
|
+
command = C$3;
|
|
2760
|
+
case C$3:
|
|
2759
2761
|
controlX = old[i + 3];
|
|
2760
2762
|
controlY = old[i + 4];
|
|
2761
2763
|
x = old[i + 5];
|
|
2762
2764
|
y = old[i + 6];
|
|
2763
|
-
data.push(C$
|
|
2765
|
+
data.push(C$3, old[i + 1], old[i + 2], controlX, controlY, x, y);
|
|
2764
2766
|
i += 7;
|
|
2765
2767
|
break;
|
|
2766
2768
|
case t:
|
|
@@ -2871,7 +2873,7 @@ const PathConvert = {
|
|
|
2871
2873
|
data.push(L$5, item.x, item.y);
|
|
2872
2874
|
break;
|
|
2873
2875
|
case 'C':
|
|
2874
|
-
data.push(C$
|
|
2876
|
+
data.push(C$3, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2875
2877
|
break;
|
|
2876
2878
|
case 'Q':
|
|
2877
2879
|
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
@@ -2898,7 +2900,7 @@ const PathConvert = {
|
|
|
2898
2900
|
};
|
|
2899
2901
|
const { current, pushData, copyData } = PathConvert;
|
|
2900
2902
|
|
|
2901
|
-
const { M: M$3, L: L$4, C: C$
|
|
2903
|
+
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;
|
|
2902
2904
|
const { getMinDistanceFrom, getRadianFrom } = PointHelper;
|
|
2903
2905
|
const { tan, min, abs: abs$2 } = Math;
|
|
2904
2906
|
const startPoint = {};
|
|
@@ -2913,7 +2915,7 @@ const PathCommandDataHelper = {
|
|
|
2913
2915
|
data.push(L$4, x, y);
|
|
2914
2916
|
},
|
|
2915
2917
|
bezierCurveTo(data, x1, y1, x2, y2, x, y) {
|
|
2916
|
-
data.push(C$
|
|
2918
|
+
data.push(C$2, x1, y1, x2, y2, x, y);
|
|
2917
2919
|
},
|
|
2918
2920
|
quadraticCurveTo(data, x1, y1, x, y) {
|
|
2919
2921
|
data.push(Q$2, x1, y1, x, y);
|
|
@@ -3075,7 +3077,7 @@ class PathCreator {
|
|
|
3075
3077
|
paint() { }
|
|
3076
3078
|
}
|
|
3077
3079
|
|
|
3078
|
-
const { M: M$2, L: L$3, C: C$
|
|
3080
|
+
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;
|
|
3079
3081
|
const debug$b = Debug.get('PathDrawer');
|
|
3080
3082
|
const PathDrawer = {
|
|
3081
3083
|
drawPathByData(drawer, data) {
|
|
@@ -3094,7 +3096,7 @@ const PathDrawer = {
|
|
|
3094
3096
|
drawer.lineTo(data[i + 1], data[i + 2]);
|
|
3095
3097
|
i += 3;
|
|
3096
3098
|
break;
|
|
3097
|
-
case C$
|
|
3099
|
+
case C$1:
|
|
3098
3100
|
drawer.bezierCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3099
3101
|
i += 7;
|
|
3100
3102
|
break;
|
|
@@ -3146,7 +3148,7 @@ const PathDrawer = {
|
|
|
3146
3148
|
}
|
|
3147
3149
|
};
|
|
3148
3150
|
|
|
3149
|
-
const { M: M$1, L: L$2, C
|
|
3151
|
+
const { M: M$1, L: L$2, C, Q, Z: Z$1, N, D, X, G, F: F$1, O, P, U } = PathCommandMap;
|
|
3150
3152
|
const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
|
|
3151
3153
|
const { addPointBounds, copy: copy$8, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
|
|
3152
3154
|
const debug$a = Debug.get('PathBounds');
|
|
@@ -3167,7 +3169,7 @@ const PathBounds = {
|
|
|
3167
3169
|
while (i < len) {
|
|
3168
3170
|
command = data[i];
|
|
3169
3171
|
if (i === 0) {
|
|
3170
|
-
if (command === Z$1 || command === C
|
|
3172
|
+
if (command === Z$1 || command === C || command === Q) {
|
|
3171
3173
|
setPoint(setPointBounds, x, y);
|
|
3172
3174
|
}
|
|
3173
3175
|
else {
|
|
@@ -3182,7 +3184,7 @@ const PathBounds = {
|
|
|
3182
3184
|
addPoint(setPointBounds, x, y);
|
|
3183
3185
|
i += 3;
|
|
3184
3186
|
break;
|
|
3185
|
-
case C
|
|
3187
|
+
case C:
|
|
3186
3188
|
toX = data[i + 5];
|
|
3187
3189
|
toY = data[i + 6];
|
|
3188
3190
|
toTwoPointBounds(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY, tempPointBounds);
|
|
@@ -3264,12 +3266,12 @@ const PathBounds = {
|
|
|
3264
3266
|
}
|
|
3265
3267
|
};
|
|
3266
3268
|
|
|
3267
|
-
const { M, L: L$1,
|
|
3269
|
+
const { M, L: L$1, Z } = PathCommandMap;
|
|
3268
3270
|
const { getCenterX, getCenterY } = PointHelper;
|
|
3269
3271
|
const { arcTo } = PathCommandDataHelper;
|
|
3270
3272
|
const PathCorner = {
|
|
3271
3273
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3272
|
-
let command;
|
|
3274
|
+
let command, commandLen;
|
|
3273
3275
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3274
3276
|
const len = data.length;
|
|
3275
3277
|
const smooth = [];
|
|
@@ -3306,15 +3308,16 @@ const PathCorner = {
|
|
|
3306
3308
|
lastX = x;
|
|
3307
3309
|
lastY = y;
|
|
3308
3310
|
break;
|
|
3309
|
-
case C:
|
|
3310
|
-
smooth.push(C, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3311
|
-
i += 7;
|
|
3312
|
-
break;
|
|
3313
3311
|
case Z:
|
|
3314
3312
|
arcTo(smooth, startX, startY, secondX, secondY, cornerRadius, lastX, lastY);
|
|
3315
3313
|
smooth.push(Z);
|
|
3316
3314
|
i += 1;
|
|
3317
3315
|
break;
|
|
3316
|
+
default:
|
|
3317
|
+
commandLen = PathNumberCommandLengthMap[command];
|
|
3318
|
+
for (let j = 0; j < commandLen; j++)
|
|
3319
|
+
smooth.push(data[i + j]);
|
|
3320
|
+
i += commandLen;
|
|
3318
3321
|
}
|
|
3319
3322
|
}
|
|
3320
3323
|
if (command !== Z) {
|
|
@@ -4073,33 +4076,45 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4073
4076
|
else if (typeof defaultValue === 'function') {
|
|
4074
4077
|
property.get = function () {
|
|
4075
4078
|
let v = this[computedKey];
|
|
4076
|
-
|
|
4077
|
-
this[computedKey] = v = defaultValue(this.__leaf);
|
|
4078
|
-
return v;
|
|
4079
|
+
return v === undefined ? defaultValue(this.__leaf) : v;
|
|
4079
4080
|
};
|
|
4080
4081
|
}
|
|
4082
|
+
else if (typeof defaultValue === 'object') {
|
|
4083
|
+
const isEmpty = isEmptyData(defaultValue);
|
|
4084
|
+
property.get = function () {
|
|
4085
|
+
let v = this[computedKey];
|
|
4086
|
+
return v === undefined ? this[computedKey] = isEmpty ? {} : DataHelper.clone(defaultValue) : v;
|
|
4087
|
+
};
|
|
4088
|
+
}
|
|
4089
|
+
const isBox = target.isBranchLeaf;
|
|
4081
4090
|
if (key === 'width') {
|
|
4082
4091
|
property.get = function () {
|
|
4083
4092
|
const v = this[computedKey];
|
|
4084
4093
|
if (v === undefined) {
|
|
4085
|
-
const t = this;
|
|
4086
|
-
|
|
4094
|
+
const t = this, naturalWidth = t.__naturalWidth, leaf = t.__leaf;
|
|
4095
|
+
if (!defaultValue || leaf.pathInputed)
|
|
4096
|
+
return leaf.boxBounds.width;
|
|
4097
|
+
if (naturalWidth)
|
|
4098
|
+
return t._height && t.__useNaturalRatio ? t._height * naturalWidth / t.__naturalHeight : naturalWidth;
|
|
4099
|
+
return (isBox && leaf.children.length) ? leaf.boxBounds.width : defaultValue;
|
|
4087
4100
|
}
|
|
4088
|
-
else
|
|
4101
|
+
else
|
|
4089
4102
|
return v;
|
|
4090
|
-
}
|
|
4091
4103
|
};
|
|
4092
4104
|
}
|
|
4093
4105
|
else if (key === 'height') {
|
|
4094
4106
|
property.get = function () {
|
|
4095
4107
|
const v = this[computedKey];
|
|
4096
4108
|
if (v === undefined) {
|
|
4097
|
-
const t = this;
|
|
4098
|
-
|
|
4109
|
+
const t = this, naturalHeight = t.__naturalHeight, leaf = t.__leaf;
|
|
4110
|
+
if (!defaultValue || leaf.pathInputed)
|
|
4111
|
+
return leaf.boxBounds.height;
|
|
4112
|
+
if (naturalHeight)
|
|
4113
|
+
return t._width && t.__useNaturalRatio ? t._width * naturalHeight / t.__naturalWidth : naturalHeight;
|
|
4114
|
+
return (isBox && leaf.children.length) ? leaf.boxBounds.height : defaultValue;
|
|
4099
4115
|
}
|
|
4100
|
-
else
|
|
4116
|
+
else
|
|
4101
4117
|
return v;
|
|
4102
|
-
}
|
|
4103
4118
|
};
|
|
4104
4119
|
}
|
|
4105
4120
|
let descriptor, find = data;
|
|
@@ -4526,7 +4541,12 @@ class LeafLayout {
|
|
|
4526
4541
|
while (root.parent && !root.parent.leafer) {
|
|
4527
4542
|
root = root.parent;
|
|
4528
4543
|
}
|
|
4529
|
-
|
|
4544
|
+
const r = root;
|
|
4545
|
+
if (r.__fullLayouting)
|
|
4546
|
+
return;
|
|
4547
|
+
r.__fullLayouting = true;
|
|
4548
|
+
Platform.layout(r);
|
|
4549
|
+
delete r.__fullLayouting;
|
|
4530
4550
|
}
|
|
4531
4551
|
}
|
|
4532
4552
|
getTransform(relative = 'world') {
|
|
@@ -6051,7 +6071,7 @@ class LeafLevelList {
|
|
|
6051
6071
|
}
|
|
6052
6072
|
}
|
|
6053
6073
|
|
|
6054
|
-
const version = "1.5.
|
|
6074
|
+
const version = "1.5.2";
|
|
6055
6075
|
|
|
6056
6076
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6057
6077
|
get allowBackgroundColor() { return false; }
|
|
@@ -7780,7 +7800,7 @@ __decorate([
|
|
|
7780
7800
|
strokeType()
|
|
7781
7801
|
], UI.prototype, "dashPattern", void 0);
|
|
7782
7802
|
__decorate([
|
|
7783
|
-
strokeType()
|
|
7803
|
+
strokeType(0)
|
|
7784
7804
|
], UI.prototype, "dashOffset", void 0);
|
|
7785
7805
|
__decorate([
|
|
7786
7806
|
strokeType(10)
|
|
@@ -7873,6 +7893,12 @@ let Group = class Group extends UI {
|
|
|
7873
7893
|
__decorate([
|
|
7874
7894
|
dataProcessor(GroupData)
|
|
7875
7895
|
], Group.prototype, "__", void 0);
|
|
7896
|
+
__decorate([
|
|
7897
|
+
boundsType(0)
|
|
7898
|
+
], Group.prototype, "width", void 0);
|
|
7899
|
+
__decorate([
|
|
7900
|
+
boundsType(0)
|
|
7901
|
+
], Group.prototype, "height", void 0);
|
|
7876
7902
|
Group = __decorate([
|
|
7877
7903
|
useModule(Branch),
|
|
7878
7904
|
registerUI()
|
|
@@ -8288,7 +8314,7 @@ let Box = class Box extends Group {
|
|
|
8288
8314
|
__updateRectBoxBounds() { }
|
|
8289
8315
|
__updateBoxBounds(_secondLayout) {
|
|
8290
8316
|
const data = this.__;
|
|
8291
|
-
if (this.children.length) {
|
|
8317
|
+
if (this.children.length && !this.pathInputed) {
|
|
8292
8318
|
if (data.__autoSide) {
|
|
8293
8319
|
if (data.__hasSurface)
|
|
8294
8320
|
this.__extraUpdate();
|
|
@@ -8357,6 +8383,12 @@ let Box = class Box extends Group {
|
|
|
8357
8383
|
__decorate([
|
|
8358
8384
|
dataProcessor(BoxData)
|
|
8359
8385
|
], Box.prototype, "__", void 0);
|
|
8386
|
+
__decorate([
|
|
8387
|
+
boundsType(100)
|
|
8388
|
+
], Box.prototype, "width", void 0);
|
|
8389
|
+
__decorate([
|
|
8390
|
+
boundsType(100)
|
|
8391
|
+
], Box.prototype, "height", void 0);
|
|
8360
8392
|
__decorate([
|
|
8361
8393
|
dataType(false)
|
|
8362
8394
|
], Box.prototype, "resizeChildren", void 0);
|
|
@@ -10347,16 +10379,20 @@ class Interaction extends InteractionBase {
|
|
|
10347
10379
|
}
|
|
10348
10380
|
|
|
10349
10381
|
function fillText(ui, canvas) {
|
|
10350
|
-
let row;
|
|
10351
|
-
const { rows, decorationY
|
|
10382
|
+
let row, data = ui.__.__textDrawData;
|
|
10383
|
+
const { rows, decorationY } = data;
|
|
10352
10384
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10353
10385
|
row = rows[i];
|
|
10354
10386
|
if (row.text)
|
|
10355
10387
|
canvas.fillText(row.text, row.x, row.y);
|
|
10356
10388
|
else if (row.data)
|
|
10357
10389
|
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
10358
|
-
|
|
10359
|
-
|
|
10390
|
+
}
|
|
10391
|
+
if (decorationY) {
|
|
10392
|
+
const { decorationColor, decorationHeight } = data;
|
|
10393
|
+
if (decorationColor)
|
|
10394
|
+
canvas.fillStyle = decorationColor;
|
|
10395
|
+
rows.forEach(row => decorationY.forEach(value => canvas.fillRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
10360
10396
|
}
|
|
10361
10397
|
}
|
|
10362
10398
|
|
|
@@ -10427,16 +10463,18 @@ function drawAlignStroke(align, stroke, isStrokes, ui, canvas) {
|
|
|
10427
10463
|
out.recycle(ui.__nowWorld);
|
|
10428
10464
|
}
|
|
10429
10465
|
function drawTextStroke(ui, canvas) {
|
|
10430
|
-
let row;
|
|
10431
|
-
const { rows, decorationY
|
|
10466
|
+
let row, data = ui.__.__textDrawData;
|
|
10467
|
+
const { rows, decorationY } = data;
|
|
10432
10468
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10433
10469
|
row = rows[i];
|
|
10434
10470
|
if (row.text)
|
|
10435
10471
|
canvas.strokeText(row.text, row.x, row.y);
|
|
10436
10472
|
else if (row.data)
|
|
10437
10473
|
row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
|
|
10438
|
-
|
|
10439
|
-
|
|
10474
|
+
}
|
|
10475
|
+
if (decorationY) {
|
|
10476
|
+
const { decorationHeight } = data;
|
|
10477
|
+
rows.forEach(row => decorationY.forEach(value => canvas.strokeRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
10440
10478
|
}
|
|
10441
10479
|
}
|
|
10442
10480
|
function drawStrokesStyle(strokes, isText, ui, canvas) {
|
|
@@ -11002,6 +11040,8 @@ function recycleImage(attrName, data) {
|
|
|
11002
11040
|
}
|
|
11003
11041
|
image.unload(paints[i].loadId, !input.some((item) => item.url === url));
|
|
11004
11042
|
}
|
|
11043
|
+
else
|
|
11044
|
+
paints[i].style = null;
|
|
11005
11045
|
}
|
|
11006
11046
|
}
|
|
11007
11047
|
return recycleMap;
|
|
@@ -11734,14 +11774,25 @@ function toTextChar(row) {
|
|
|
11734
11774
|
}
|
|
11735
11775
|
|
|
11736
11776
|
function decorationText(drawData, style) {
|
|
11737
|
-
|
|
11777
|
+
let type;
|
|
11778
|
+
const { fontSize, textDecoration } = style;
|
|
11738
11779
|
drawData.decorationHeight = fontSize / 11;
|
|
11739
|
-
|
|
11780
|
+
if (typeof textDecoration === 'object') {
|
|
11781
|
+
type = textDecoration.type;
|
|
11782
|
+
if (textDecoration.color)
|
|
11783
|
+
drawData.decorationColor = ColorConvert.string(textDecoration.color);
|
|
11784
|
+
}
|
|
11785
|
+
else
|
|
11786
|
+
type = textDecoration;
|
|
11787
|
+
switch (type) {
|
|
11740
11788
|
case 'under':
|
|
11741
|
-
drawData.decorationY = fontSize * 0.15;
|
|
11789
|
+
drawData.decorationY = [fontSize * 0.15];
|
|
11742
11790
|
break;
|
|
11743
11791
|
case 'delete':
|
|
11744
|
-
drawData.decorationY = -fontSize * 0.35;
|
|
11792
|
+
drawData.decorationY = [-fontSize * 0.35];
|
|
11793
|
+
break;
|
|
11794
|
+
case 'under-delete':
|
|
11795
|
+
drawData.decorationY = [fontSize * 0.15, -fontSize * 0.35];
|
|
11745
11796
|
}
|
|
11746
11797
|
}
|
|
11747
11798
|
|
|
@@ -11849,5 +11900,5 @@ try {
|
|
|
11849
11900
|
}
|
|
11850
11901
|
catch (_a) { }
|
|
11851
11902
|
|
|
11852
|
-
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, 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, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
11903
|
+
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, 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, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isEmptyData, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
11853
11904
|
//# sourceMappingURL=miniapp.module.js.map
|