leafer-ui 1.5.1 → 1.5.3
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/README.md +0 -56
- package/dist/web.cjs +31 -12
- package/dist/web.cjs.map +1 -1
- package/dist/web.esm.js +31 -12
- package/dist/web.esm.js.map +1 -1
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +106 -50
- package/dist/web.js.map +1 -1
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +106 -51
- package/dist/web.module.js.map +1 -1
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/web.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.
|
|
@@ -2345,7 +2349,7 @@ const RectHelper = {
|
|
|
2345
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;
|
|
2346
2350
|
const { setPoint: setPoint$1, addPoint: addPoint$1 } = TwoPointBoundsHelper;
|
|
2347
2351
|
const { set, toNumberPoints } = PointHelper;
|
|
2348
|
-
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;
|
|
2349
2353
|
const tempPoint$2 = {};
|
|
2350
2354
|
const BezierHelper = {
|
|
2351
2355
|
points(data, originPoints, curve, close) {
|
|
@@ -2380,7 +2384,7 @@ const BezierHelper = {
|
|
|
2380
2384
|
data.push(Q$4, c1X, c1Y, bX, bY);
|
|
2381
2385
|
}
|
|
2382
2386
|
else {
|
|
2383
|
-
data.push(C$
|
|
2387
|
+
data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2384
2388
|
}
|
|
2385
2389
|
c2X = bX + cb * cX;
|
|
2386
2390
|
c2Y = bY + cb * cY;
|
|
@@ -2485,7 +2489,7 @@ const BezierHelper = {
|
|
|
2485
2489
|
x2 = cx + x + control * (rotationCos * radiusX * endSin + rotationSin * radiusY * endCos);
|
|
2486
2490
|
y2 = cy + y + control * (rotationSin * radiusX * endSin - rotationCos * radiusY * endCos);
|
|
2487
2491
|
if (data)
|
|
2488
|
-
data.push(C$
|
|
2492
|
+
data.push(C$4, x1, y1, x2, y2, cx + x, cy + y);
|
|
2489
2493
|
if (setPointBounds)
|
|
2490
2494
|
toTwoPointBounds$1(cx + startX, cy + startY, x1, y1, x2, y2, cx + x, cy + y, setPointBounds, true);
|
|
2491
2495
|
startX = x;
|
|
@@ -2499,7 +2503,7 @@ const BezierHelper = {
|
|
|
2499
2503
|
set(setEndPoint, cx + x, cy + y);
|
|
2500
2504
|
},
|
|
2501
2505
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2502
|
-
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);
|
|
2503
2507
|
},
|
|
2504
2508
|
toTwoPointBoundsByQuadraticCurve(fromX, fromY, x1, y1, toX, toY, pointBounds, addMode) {
|
|
2505
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);
|
|
@@ -2607,7 +2611,7 @@ const EllipseHelper = {
|
|
|
2607
2611
|
}
|
|
2608
2612
|
};
|
|
2609
2613
|
|
|
2610
|
-
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;
|
|
2611
2615
|
const { rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
|
|
2612
2616
|
const { ellipticalArc } = EllipseHelper;
|
|
2613
2617
|
const debug$d = Debug.get('PathConvert');
|
|
@@ -2735,14 +2739,14 @@ const PathConvert = {
|
|
|
2735
2739
|
old[i + 4] += y;
|
|
2736
2740
|
command = S;
|
|
2737
2741
|
case S:
|
|
2738
|
-
smooth = (lastCommand === C$
|
|
2742
|
+
smooth = (lastCommand === C$3) || (lastCommand === S);
|
|
2739
2743
|
x1 = smooth ? (x * 2 - controlX) : old[i + 1];
|
|
2740
2744
|
y1 = smooth ? (y * 2 - controlY) : old[i + 2];
|
|
2741
2745
|
controlX = old[i + 1];
|
|
2742
2746
|
controlY = old[i + 2];
|
|
2743
2747
|
x = old[i + 3];
|
|
2744
2748
|
y = old[i + 4];
|
|
2745
|
-
data.push(C$
|
|
2749
|
+
data.push(C$3, x1, y1, controlX, controlY, x, y);
|
|
2746
2750
|
i += 5;
|
|
2747
2751
|
break;
|
|
2748
2752
|
case c:
|
|
@@ -2752,13 +2756,13 @@ const PathConvert = {
|
|
|
2752
2756
|
old[i + 4] += y;
|
|
2753
2757
|
old[i + 5] += x;
|
|
2754
2758
|
old[i + 6] += y;
|
|
2755
|
-
command = C$
|
|
2756
|
-
case C$
|
|
2759
|
+
command = C$3;
|
|
2760
|
+
case C$3:
|
|
2757
2761
|
controlX = old[i + 3];
|
|
2758
2762
|
controlY = old[i + 4];
|
|
2759
2763
|
x = old[i + 5];
|
|
2760
2764
|
y = old[i + 6];
|
|
2761
|
-
data.push(C$
|
|
2765
|
+
data.push(C$3, old[i + 1], old[i + 2], controlX, controlY, x, y);
|
|
2762
2766
|
i += 7;
|
|
2763
2767
|
break;
|
|
2764
2768
|
case t:
|
|
@@ -2869,7 +2873,7 @@ const PathConvert = {
|
|
|
2869
2873
|
data.push(L$5, item.x, item.y);
|
|
2870
2874
|
break;
|
|
2871
2875
|
case 'C':
|
|
2872
|
-
data.push(C$
|
|
2876
|
+
data.push(C$3, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2873
2877
|
break;
|
|
2874
2878
|
case 'Q':
|
|
2875
2879
|
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
@@ -2896,7 +2900,7 @@ const PathConvert = {
|
|
|
2896
2900
|
};
|
|
2897
2901
|
const { current, pushData, copyData } = PathConvert;
|
|
2898
2902
|
|
|
2899
|
-
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;
|
|
2900
2904
|
const { getMinDistanceFrom, getRadianFrom } = PointHelper;
|
|
2901
2905
|
const { tan, min, abs: abs$2 } = Math;
|
|
2902
2906
|
const startPoint = {};
|
|
@@ -2911,7 +2915,7 @@ const PathCommandDataHelper = {
|
|
|
2911
2915
|
data.push(L$4, x, y);
|
|
2912
2916
|
},
|
|
2913
2917
|
bezierCurveTo(data, x1, y1, x2, y2, x, y) {
|
|
2914
|
-
data.push(C$
|
|
2918
|
+
data.push(C$2, x1, y1, x2, y2, x, y);
|
|
2915
2919
|
},
|
|
2916
2920
|
quadraticCurveTo(data, x1, y1, x, y) {
|
|
2917
2921
|
data.push(Q$2, x1, y1, x, y);
|
|
@@ -3073,7 +3077,7 @@ class PathCreator {
|
|
|
3073
3077
|
paint() { }
|
|
3074
3078
|
}
|
|
3075
3079
|
|
|
3076
|
-
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;
|
|
3077
3081
|
const debug$c = Debug.get('PathDrawer');
|
|
3078
3082
|
const PathDrawer = {
|
|
3079
3083
|
drawPathByData(drawer, data) {
|
|
@@ -3092,7 +3096,7 @@ const PathDrawer = {
|
|
|
3092
3096
|
drawer.lineTo(data[i + 1], data[i + 2]);
|
|
3093
3097
|
i += 3;
|
|
3094
3098
|
break;
|
|
3095
|
-
case C$
|
|
3099
|
+
case C$1:
|
|
3096
3100
|
drawer.bezierCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3097
3101
|
i += 7;
|
|
3098
3102
|
break;
|
|
@@ -3144,7 +3148,7 @@ const PathDrawer = {
|
|
|
3144
3148
|
}
|
|
3145
3149
|
};
|
|
3146
3150
|
|
|
3147
|
-
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;
|
|
3148
3152
|
const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
|
|
3149
3153
|
const { addPointBounds, copy: copy$8, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
|
|
3150
3154
|
const debug$b = Debug.get('PathBounds');
|
|
@@ -3165,7 +3169,7 @@ const PathBounds = {
|
|
|
3165
3169
|
while (i < len) {
|
|
3166
3170
|
command = data[i];
|
|
3167
3171
|
if (i === 0) {
|
|
3168
|
-
if (command === Z$1 || command === C
|
|
3172
|
+
if (command === Z$1 || command === C || command === Q) {
|
|
3169
3173
|
setPoint(setPointBounds, x, y);
|
|
3170
3174
|
}
|
|
3171
3175
|
else {
|
|
@@ -3180,7 +3184,7 @@ const PathBounds = {
|
|
|
3180
3184
|
addPoint(setPointBounds, x, y);
|
|
3181
3185
|
i += 3;
|
|
3182
3186
|
break;
|
|
3183
|
-
case C
|
|
3187
|
+
case C:
|
|
3184
3188
|
toX = data[i + 5];
|
|
3185
3189
|
toY = data[i + 6];
|
|
3186
3190
|
toTwoPointBounds(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY, tempPointBounds);
|
|
@@ -3262,12 +3266,12 @@ const PathBounds = {
|
|
|
3262
3266
|
}
|
|
3263
3267
|
};
|
|
3264
3268
|
|
|
3265
|
-
const { M, L: L$1,
|
|
3269
|
+
const { M, L: L$1, Z } = PathCommandMap;
|
|
3266
3270
|
const { getCenterX, getCenterY } = PointHelper;
|
|
3267
3271
|
const { arcTo } = PathCommandDataHelper;
|
|
3268
3272
|
const PathCorner = {
|
|
3269
3273
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3270
|
-
let command;
|
|
3274
|
+
let command, commandLen;
|
|
3271
3275
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3272
3276
|
const len = data.length;
|
|
3273
3277
|
const smooth = [];
|
|
@@ -3304,15 +3308,16 @@ const PathCorner = {
|
|
|
3304
3308
|
lastX = x;
|
|
3305
3309
|
lastY = y;
|
|
3306
3310
|
break;
|
|
3307
|
-
case C:
|
|
3308
|
-
smooth.push(C, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3309
|
-
i += 7;
|
|
3310
|
-
break;
|
|
3311
3311
|
case Z:
|
|
3312
3312
|
arcTo(smooth, startX, startY, secondX, secondY, cornerRadius, lastX, lastY);
|
|
3313
3313
|
smooth.push(Z);
|
|
3314
3314
|
i += 1;
|
|
3315
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;
|
|
3316
3321
|
}
|
|
3317
3322
|
}
|
|
3318
3323
|
if (command !== Z) {
|
|
@@ -4074,28 +4079,42 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4074
4079
|
return v === undefined ? defaultValue(this.__leaf) : v;
|
|
4075
4080
|
};
|
|
4076
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;
|
|
4077
4090
|
if (key === 'width') {
|
|
4078
4091
|
property.get = function () {
|
|
4079
4092
|
const v = this[computedKey];
|
|
4080
4093
|
if (v === undefined) {
|
|
4081
|
-
const t = this;
|
|
4082
|
-
|
|
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;
|
|
4083
4100
|
}
|
|
4084
|
-
else
|
|
4101
|
+
else
|
|
4085
4102
|
return v;
|
|
4086
|
-
}
|
|
4087
4103
|
};
|
|
4088
4104
|
}
|
|
4089
4105
|
else if (key === 'height') {
|
|
4090
4106
|
property.get = function () {
|
|
4091
4107
|
const v = this[computedKey];
|
|
4092
4108
|
if (v === undefined) {
|
|
4093
|
-
const t = this;
|
|
4094
|
-
|
|
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;
|
|
4095
4115
|
}
|
|
4096
|
-
else
|
|
4116
|
+
else
|
|
4097
4117
|
return v;
|
|
4098
|
-
}
|
|
4099
4118
|
};
|
|
4100
4119
|
}
|
|
4101
4120
|
let descriptor, find = data;
|
|
@@ -4522,7 +4541,12 @@ class LeafLayout {
|
|
|
4522
4541
|
while (root.parent && !root.parent.leafer) {
|
|
4523
4542
|
root = root.parent;
|
|
4524
4543
|
}
|
|
4525
|
-
|
|
4544
|
+
const r = root;
|
|
4545
|
+
if (r.__fullLayouting)
|
|
4546
|
+
return;
|
|
4547
|
+
r.__fullLayouting = true;
|
|
4548
|
+
Platform.layout(r);
|
|
4549
|
+
delete r.__fullLayouting;
|
|
4526
4550
|
}
|
|
4527
4551
|
}
|
|
4528
4552
|
getTransform(relative = 'world') {
|
|
@@ -6047,7 +6071,7 @@ class LeafLevelList {
|
|
|
6047
6071
|
}
|
|
6048
6072
|
}
|
|
6049
6073
|
|
|
6050
|
-
const version = "1.5.
|
|
6074
|
+
const version = "1.5.3";
|
|
6051
6075
|
|
|
6052
6076
|
const debug$5 = Debug.get('LeaferCanvas');
|
|
6053
6077
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -7818,7 +7842,7 @@ __decorate([
|
|
|
7818
7842
|
strokeType()
|
|
7819
7843
|
], UI.prototype, "dashPattern", void 0);
|
|
7820
7844
|
__decorate([
|
|
7821
|
-
strokeType()
|
|
7845
|
+
strokeType(0)
|
|
7822
7846
|
], UI.prototype, "dashOffset", void 0);
|
|
7823
7847
|
__decorate([
|
|
7824
7848
|
strokeType(10)
|
|
@@ -7911,6 +7935,12 @@ let Group = class Group extends UI {
|
|
|
7911
7935
|
__decorate([
|
|
7912
7936
|
dataProcessor(GroupData)
|
|
7913
7937
|
], Group.prototype, "__", void 0);
|
|
7938
|
+
__decorate([
|
|
7939
|
+
boundsType(0)
|
|
7940
|
+
], Group.prototype, "width", void 0);
|
|
7941
|
+
__decorate([
|
|
7942
|
+
boundsType(0)
|
|
7943
|
+
], Group.prototype, "height", void 0);
|
|
7914
7944
|
Group = __decorate([
|
|
7915
7945
|
useModule(Branch),
|
|
7916
7946
|
registerUI()
|
|
@@ -8326,7 +8356,7 @@ let Box = class Box extends Group {
|
|
|
8326
8356
|
__updateRectBoxBounds() { }
|
|
8327
8357
|
__updateBoxBounds(_secondLayout) {
|
|
8328
8358
|
const data = this.__;
|
|
8329
|
-
if (this.children.length) {
|
|
8359
|
+
if (this.children.length && !this.pathInputed) {
|
|
8330
8360
|
if (data.__autoSide) {
|
|
8331
8361
|
if (data.__hasSurface)
|
|
8332
8362
|
this.__extraUpdate();
|
|
@@ -8395,6 +8425,12 @@ let Box = class Box extends Group {
|
|
|
8395
8425
|
__decorate([
|
|
8396
8426
|
dataProcessor(BoxData)
|
|
8397
8427
|
], Box.prototype, "__", void 0);
|
|
8428
|
+
__decorate([
|
|
8429
|
+
boundsType(100)
|
|
8430
|
+
], Box.prototype, "width", void 0);
|
|
8431
|
+
__decorate([
|
|
8432
|
+
boundsType(100)
|
|
8433
|
+
], Box.prototype, "height", void 0);
|
|
8398
8434
|
__decorate([
|
|
8399
8435
|
dataType(false)
|
|
8400
8436
|
], Box.prototype, "resizeChildren", void 0);
|
|
@@ -10589,16 +10625,20 @@ class Interaction extends InteractionBase {
|
|
|
10589
10625
|
}
|
|
10590
10626
|
|
|
10591
10627
|
function fillText(ui, canvas) {
|
|
10592
|
-
let row;
|
|
10593
|
-
const { rows, decorationY
|
|
10628
|
+
let row, data = ui.__.__textDrawData;
|
|
10629
|
+
const { rows, decorationY } = data;
|
|
10594
10630
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10595
10631
|
row = rows[i];
|
|
10596
10632
|
if (row.text)
|
|
10597
10633
|
canvas.fillText(row.text, row.x, row.y);
|
|
10598
10634
|
else if (row.data)
|
|
10599
10635
|
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
10600
|
-
|
|
10601
|
-
|
|
10636
|
+
}
|
|
10637
|
+
if (decorationY) {
|
|
10638
|
+
const { decorationColor, decorationHeight } = data;
|
|
10639
|
+
if (decorationColor)
|
|
10640
|
+
canvas.fillStyle = decorationColor;
|
|
10641
|
+
rows.forEach(row => decorationY.forEach(value => canvas.fillRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
10602
10642
|
}
|
|
10603
10643
|
}
|
|
10604
10644
|
|
|
@@ -10669,16 +10709,18 @@ function drawAlignStroke(align, stroke, isStrokes, ui, canvas) {
|
|
|
10669
10709
|
out.recycle(ui.__nowWorld);
|
|
10670
10710
|
}
|
|
10671
10711
|
function drawTextStroke(ui, canvas) {
|
|
10672
|
-
let row;
|
|
10673
|
-
const { rows, decorationY
|
|
10712
|
+
let row, data = ui.__.__textDrawData;
|
|
10713
|
+
const { rows, decorationY } = data;
|
|
10674
10714
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10675
10715
|
row = rows[i];
|
|
10676
10716
|
if (row.text)
|
|
10677
10717
|
canvas.strokeText(row.text, row.x, row.y);
|
|
10678
10718
|
else if (row.data)
|
|
10679
10719
|
row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
|
|
10680
|
-
|
|
10681
|
-
|
|
10720
|
+
}
|
|
10721
|
+
if (decorationY) {
|
|
10722
|
+
const { decorationHeight } = data;
|
|
10723
|
+
rows.forEach(row => decorationY.forEach(value => canvas.strokeRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
10682
10724
|
}
|
|
10683
10725
|
}
|
|
10684
10726
|
function drawStrokesStyle(strokes, isText, ui, canvas) {
|
|
@@ -11244,6 +11286,8 @@ function recycleImage(attrName, data) {
|
|
|
11244
11286
|
}
|
|
11245
11287
|
image.unload(paints[i].loadId, !input.some((item) => item.url === url));
|
|
11246
11288
|
}
|
|
11289
|
+
else
|
|
11290
|
+
paints[i].style = null;
|
|
11247
11291
|
}
|
|
11248
11292
|
}
|
|
11249
11293
|
return recycleMap;
|
|
@@ -11976,14 +12020,25 @@ function toTextChar(row) {
|
|
|
11976
12020
|
}
|
|
11977
12021
|
|
|
11978
12022
|
function decorationText(drawData, style) {
|
|
11979
|
-
|
|
12023
|
+
let type;
|
|
12024
|
+
const { fontSize, textDecoration } = style;
|
|
11980
12025
|
drawData.decorationHeight = fontSize / 11;
|
|
11981
|
-
|
|
12026
|
+
if (typeof textDecoration === 'object') {
|
|
12027
|
+
type = textDecoration.type;
|
|
12028
|
+
if (textDecoration.color)
|
|
12029
|
+
drawData.decorationColor = ColorConvert.string(textDecoration.color);
|
|
12030
|
+
}
|
|
12031
|
+
else
|
|
12032
|
+
type = textDecoration;
|
|
12033
|
+
switch (type) {
|
|
11982
12034
|
case 'under':
|
|
11983
|
-
drawData.decorationY = fontSize * 0.15;
|
|
12035
|
+
drawData.decorationY = [fontSize * 0.15];
|
|
11984
12036
|
break;
|
|
11985
12037
|
case 'delete':
|
|
11986
|
-
drawData.decorationY = -fontSize * 0.35;
|
|
12038
|
+
drawData.decorationY = [-fontSize * 0.35];
|
|
12039
|
+
break;
|
|
12040
|
+
case 'under-delete':
|
|
12041
|
+
drawData.decorationY = [fontSize * 0.15, -fontSize * 0.35];
|
|
11987
12042
|
}
|
|
11988
12043
|
}
|
|
11989
12044
|
|
|
@@ -12084,5 +12139,5 @@ Object.assign(Creator, {
|
|
|
12084
12139
|
});
|
|
12085
12140
|
useCanvas();
|
|
12086
12141
|
|
|
12087
|
-
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$1 as DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image$1 as 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$1 as 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 };
|
|
12142
|
+
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$1 as DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image$1 as 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$1 as 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 };
|
|
12088
12143
|
//# sourceMappingURL=web.module.js.map
|