@leafer-draw/worker 1.5.1 → 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/worker.cjs +31 -12
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.esm.js +31 -12
- package/dist/worker.esm.js.map +1 -1
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.esm.min.js.map +1 -1
- package/dist/worker.js +106 -50
- package/dist/worker.js.map +1 -1
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.cjs.map +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +106 -51
- package/dist/worker.module.js.map +1 -1
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +7 -7
package/dist/worker.js
CHANGED
|
@@ -119,8 +119,9 @@ var LeaferUI = (function (exports) {
|
|
|
119
119
|
if (!scaleData)
|
|
120
120
|
scaleData = {};
|
|
121
121
|
if (size) {
|
|
122
|
-
|
|
123
|
-
scaleData.
|
|
122
|
+
const scaleX = (typeof size === 'number' ? size : size.width || 0) / originSize.width, scaleY = (typeof size === 'number' ? size : size.height || 0) / originSize.height;
|
|
123
|
+
scaleData.scaleX = scaleX || scaleY || 1;
|
|
124
|
+
scaleData.scaleY = scaleY || scaleX || 1;
|
|
124
125
|
}
|
|
125
126
|
else if (scale)
|
|
126
127
|
MathHelper.assignScale(scaleData, scale);
|
|
@@ -1693,6 +1694,9 @@ var LeaferUI = (function (exports) {
|
|
|
1693
1694
|
function isNull(value) {
|
|
1694
1695
|
return value === undefined || value === null;
|
|
1695
1696
|
}
|
|
1697
|
+
function isEmptyData(value) {
|
|
1698
|
+
return JSON.stringify(value) === '{}';
|
|
1699
|
+
}
|
|
1696
1700
|
|
|
1697
1701
|
/******************************************************************************
|
|
1698
1702
|
Copyright (c) Microsoft Corporation.
|
|
@@ -2348,7 +2352,7 @@ var LeaferUI = (function (exports) {
|
|
|
2348
2352
|
const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
|
|
2349
2353
|
const { setPoint: setPoint$1, addPoint: addPoint$1 } = TwoPointBoundsHelper;
|
|
2350
2354
|
const { set, toNumberPoints } = PointHelper;
|
|
2351
|
-
const { M: M$5, L: L$6, C: C$
|
|
2355
|
+
const { M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5 } = PathCommandMap;
|
|
2352
2356
|
const tempPoint$2 = {};
|
|
2353
2357
|
const BezierHelper = {
|
|
2354
2358
|
points(data, originPoints, curve, close) {
|
|
@@ -2383,7 +2387,7 @@ var LeaferUI = (function (exports) {
|
|
|
2383
2387
|
data.push(Q$4, c1X, c1Y, bX, bY);
|
|
2384
2388
|
}
|
|
2385
2389
|
else {
|
|
2386
|
-
data.push(C$
|
|
2390
|
+
data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2387
2391
|
}
|
|
2388
2392
|
c2X = bX + cb * cX;
|
|
2389
2393
|
c2Y = bY + cb * cY;
|
|
@@ -2488,7 +2492,7 @@ var LeaferUI = (function (exports) {
|
|
|
2488
2492
|
x2 = cx + x + control * (rotationCos * radiusX * endSin + rotationSin * radiusY * endCos);
|
|
2489
2493
|
y2 = cy + y + control * (rotationSin * radiusX * endSin - rotationCos * radiusY * endCos);
|
|
2490
2494
|
if (data)
|
|
2491
|
-
data.push(C$
|
|
2495
|
+
data.push(C$4, x1, y1, x2, y2, cx + x, cy + y);
|
|
2492
2496
|
if (setPointBounds)
|
|
2493
2497
|
toTwoPointBounds$1(cx + startX, cy + startY, x1, y1, x2, y2, cx + x, cy + y, setPointBounds, true);
|
|
2494
2498
|
startX = x;
|
|
@@ -2502,7 +2506,7 @@ var LeaferUI = (function (exports) {
|
|
|
2502
2506
|
set(setEndPoint, cx + x, cy + y);
|
|
2503
2507
|
},
|
|
2504
2508
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2505
|
-
data.push(C$
|
|
2509
|
+
data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
2506
2510
|
},
|
|
2507
2511
|
toTwoPointBoundsByQuadraticCurve(fromX, fromY, x1, y1, toX, toY, pointBounds, addMode) {
|
|
2508
2512
|
toTwoPointBounds$1(fromX, fromY, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY, pointBounds, addMode);
|
|
@@ -2610,7 +2614,7 @@ var LeaferUI = (function (exports) {
|
|
|
2610
2614
|
}
|
|
2611
2615
|
};
|
|
2612
2616
|
|
|
2613
|
-
const { M: M$4, m, L: L$5, l, H, h, V, v, C: C$
|
|
2617
|
+
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;
|
|
2614
2618
|
const { rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
|
|
2615
2619
|
const { ellipticalArc } = EllipseHelper;
|
|
2616
2620
|
const debug$b = Debug.get('PathConvert');
|
|
@@ -2738,14 +2742,14 @@ var LeaferUI = (function (exports) {
|
|
|
2738
2742
|
old[i + 4] += y;
|
|
2739
2743
|
command = S;
|
|
2740
2744
|
case S:
|
|
2741
|
-
smooth = (lastCommand === C$
|
|
2745
|
+
smooth = (lastCommand === C$3) || (lastCommand === S);
|
|
2742
2746
|
x1 = smooth ? (x * 2 - controlX) : old[i + 1];
|
|
2743
2747
|
y1 = smooth ? (y * 2 - controlY) : old[i + 2];
|
|
2744
2748
|
controlX = old[i + 1];
|
|
2745
2749
|
controlY = old[i + 2];
|
|
2746
2750
|
x = old[i + 3];
|
|
2747
2751
|
y = old[i + 4];
|
|
2748
|
-
data.push(C$
|
|
2752
|
+
data.push(C$3, x1, y1, controlX, controlY, x, y);
|
|
2749
2753
|
i += 5;
|
|
2750
2754
|
break;
|
|
2751
2755
|
case c:
|
|
@@ -2755,13 +2759,13 @@ var LeaferUI = (function (exports) {
|
|
|
2755
2759
|
old[i + 4] += y;
|
|
2756
2760
|
old[i + 5] += x;
|
|
2757
2761
|
old[i + 6] += y;
|
|
2758
|
-
command = C$
|
|
2759
|
-
case C$
|
|
2762
|
+
command = C$3;
|
|
2763
|
+
case C$3:
|
|
2760
2764
|
controlX = old[i + 3];
|
|
2761
2765
|
controlY = old[i + 4];
|
|
2762
2766
|
x = old[i + 5];
|
|
2763
2767
|
y = old[i + 6];
|
|
2764
|
-
data.push(C$
|
|
2768
|
+
data.push(C$3, old[i + 1], old[i + 2], controlX, controlY, x, y);
|
|
2765
2769
|
i += 7;
|
|
2766
2770
|
break;
|
|
2767
2771
|
case t:
|
|
@@ -2872,7 +2876,7 @@ var LeaferUI = (function (exports) {
|
|
|
2872
2876
|
data.push(L$5, item.x, item.y);
|
|
2873
2877
|
break;
|
|
2874
2878
|
case 'C':
|
|
2875
|
-
data.push(C$
|
|
2879
|
+
data.push(C$3, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2876
2880
|
break;
|
|
2877
2881
|
case 'Q':
|
|
2878
2882
|
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
@@ -2899,7 +2903,7 @@ var LeaferUI = (function (exports) {
|
|
|
2899
2903
|
};
|
|
2900
2904
|
const { current, pushData, copyData } = PathConvert;
|
|
2901
2905
|
|
|
2902
|
-
const { M: M$3, L: L$4, C: C$
|
|
2906
|
+
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;
|
|
2903
2907
|
const { getMinDistanceFrom, getRadianFrom } = PointHelper;
|
|
2904
2908
|
const { tan, min, abs: abs$2 } = Math;
|
|
2905
2909
|
const startPoint = {};
|
|
@@ -2914,7 +2918,7 @@ var LeaferUI = (function (exports) {
|
|
|
2914
2918
|
data.push(L$4, x, y);
|
|
2915
2919
|
},
|
|
2916
2920
|
bezierCurveTo(data, x1, y1, x2, y2, x, y) {
|
|
2917
|
-
data.push(C$
|
|
2921
|
+
data.push(C$2, x1, y1, x2, y2, x, y);
|
|
2918
2922
|
},
|
|
2919
2923
|
quadraticCurveTo(data, x1, y1, x, y) {
|
|
2920
2924
|
data.push(Q$2, x1, y1, x, y);
|
|
@@ -3076,7 +3080,7 @@ var LeaferUI = (function (exports) {
|
|
|
3076
3080
|
paint() { }
|
|
3077
3081
|
}
|
|
3078
3082
|
|
|
3079
|
-
const { M: M$2, L: L$3, C: C$
|
|
3083
|
+
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;
|
|
3080
3084
|
const debug$a = Debug.get('PathDrawer');
|
|
3081
3085
|
const PathDrawer = {
|
|
3082
3086
|
drawPathByData(drawer, data) {
|
|
@@ -3095,7 +3099,7 @@ var LeaferUI = (function (exports) {
|
|
|
3095
3099
|
drawer.lineTo(data[i + 1], data[i + 2]);
|
|
3096
3100
|
i += 3;
|
|
3097
3101
|
break;
|
|
3098
|
-
case C$
|
|
3102
|
+
case C$1:
|
|
3099
3103
|
drawer.bezierCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3100
3104
|
i += 7;
|
|
3101
3105
|
break;
|
|
@@ -3147,7 +3151,7 @@ var LeaferUI = (function (exports) {
|
|
|
3147
3151
|
}
|
|
3148
3152
|
};
|
|
3149
3153
|
|
|
3150
|
-
const { M: M$1, L: L$2, C
|
|
3154
|
+
const { M: M$1, L: L$2, C, Q, Z: Z$1, N, D, X, G, F: F$1, O, P, U } = PathCommandMap;
|
|
3151
3155
|
const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
|
|
3152
3156
|
const { addPointBounds, copy: copy$7, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
|
|
3153
3157
|
const debug$9 = Debug.get('PathBounds');
|
|
@@ -3168,7 +3172,7 @@ var LeaferUI = (function (exports) {
|
|
|
3168
3172
|
while (i < len) {
|
|
3169
3173
|
command = data[i];
|
|
3170
3174
|
if (i === 0) {
|
|
3171
|
-
if (command === Z$1 || command === C
|
|
3175
|
+
if (command === Z$1 || command === C || command === Q) {
|
|
3172
3176
|
setPoint(setPointBounds, x, y);
|
|
3173
3177
|
}
|
|
3174
3178
|
else {
|
|
@@ -3183,7 +3187,7 @@ var LeaferUI = (function (exports) {
|
|
|
3183
3187
|
addPoint(setPointBounds, x, y);
|
|
3184
3188
|
i += 3;
|
|
3185
3189
|
break;
|
|
3186
|
-
case C
|
|
3190
|
+
case C:
|
|
3187
3191
|
toX = data[i + 5];
|
|
3188
3192
|
toY = data[i + 6];
|
|
3189
3193
|
toTwoPointBounds(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY, tempPointBounds);
|
|
@@ -3265,12 +3269,12 @@ var LeaferUI = (function (exports) {
|
|
|
3265
3269
|
}
|
|
3266
3270
|
};
|
|
3267
3271
|
|
|
3268
|
-
const { M, L: L$1,
|
|
3272
|
+
const { M, L: L$1, Z } = PathCommandMap;
|
|
3269
3273
|
const { getCenterX, getCenterY } = PointHelper;
|
|
3270
3274
|
const { arcTo } = PathCommandDataHelper;
|
|
3271
3275
|
const PathCorner = {
|
|
3272
3276
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3273
|
-
let command;
|
|
3277
|
+
let command, commandLen;
|
|
3274
3278
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3275
3279
|
const len = data.length;
|
|
3276
3280
|
const smooth = [];
|
|
@@ -3307,15 +3311,16 @@ var LeaferUI = (function (exports) {
|
|
|
3307
3311
|
lastX = x;
|
|
3308
3312
|
lastY = y;
|
|
3309
3313
|
break;
|
|
3310
|
-
case C:
|
|
3311
|
-
smooth.push(C, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3312
|
-
i += 7;
|
|
3313
|
-
break;
|
|
3314
3314
|
case Z:
|
|
3315
3315
|
arcTo(smooth, startX, startY, secondX, secondY, cornerRadius, lastX, lastY);
|
|
3316
3316
|
smooth.push(Z);
|
|
3317
3317
|
i += 1;
|
|
3318
3318
|
break;
|
|
3319
|
+
default:
|
|
3320
|
+
commandLen = PathNumberCommandLengthMap[command];
|
|
3321
|
+
for (let j = 0; j < commandLen; j++)
|
|
3322
|
+
smooth.push(data[i + j]);
|
|
3323
|
+
i += commandLen;
|
|
3319
3324
|
}
|
|
3320
3325
|
}
|
|
3321
3326
|
if (command !== Z) {
|
|
@@ -4077,28 +4082,42 @@ var LeaferUI = (function (exports) {
|
|
|
4077
4082
|
return v === undefined ? defaultValue(this.__leaf) : v;
|
|
4078
4083
|
};
|
|
4079
4084
|
}
|
|
4085
|
+
else if (typeof defaultValue === 'object') {
|
|
4086
|
+
const isEmpty = isEmptyData(defaultValue);
|
|
4087
|
+
property.get = function () {
|
|
4088
|
+
let v = this[computedKey];
|
|
4089
|
+
return v === undefined ? this[computedKey] = isEmpty ? {} : DataHelper.clone(defaultValue) : v;
|
|
4090
|
+
};
|
|
4091
|
+
}
|
|
4092
|
+
const isBox = target.isBranchLeaf;
|
|
4080
4093
|
if (key === 'width') {
|
|
4081
4094
|
property.get = function () {
|
|
4082
4095
|
const v = this[computedKey];
|
|
4083
4096
|
if (v === undefined) {
|
|
4084
|
-
const t = this;
|
|
4085
|
-
|
|
4097
|
+
const t = this, naturalWidth = t.__naturalWidth, leaf = t.__leaf;
|
|
4098
|
+
if (!defaultValue || leaf.pathInputed)
|
|
4099
|
+
return leaf.boxBounds.width;
|
|
4100
|
+
if (naturalWidth)
|
|
4101
|
+
return t._height && t.__useNaturalRatio ? t._height * naturalWidth / t.__naturalHeight : naturalWidth;
|
|
4102
|
+
return (isBox && leaf.children.length) ? leaf.boxBounds.width : defaultValue;
|
|
4086
4103
|
}
|
|
4087
|
-
else
|
|
4104
|
+
else
|
|
4088
4105
|
return v;
|
|
4089
|
-
}
|
|
4090
4106
|
};
|
|
4091
4107
|
}
|
|
4092
4108
|
else if (key === 'height') {
|
|
4093
4109
|
property.get = function () {
|
|
4094
4110
|
const v = this[computedKey];
|
|
4095
4111
|
if (v === undefined) {
|
|
4096
|
-
const t = this;
|
|
4097
|
-
|
|
4112
|
+
const t = this, naturalHeight = t.__naturalHeight, leaf = t.__leaf;
|
|
4113
|
+
if (!defaultValue || leaf.pathInputed)
|
|
4114
|
+
return leaf.boxBounds.height;
|
|
4115
|
+
if (naturalHeight)
|
|
4116
|
+
return t._width && t.__useNaturalRatio ? t._width * naturalHeight / t.__naturalWidth : naturalHeight;
|
|
4117
|
+
return (isBox && leaf.children.length) ? leaf.boxBounds.height : defaultValue;
|
|
4098
4118
|
}
|
|
4099
|
-
else
|
|
4119
|
+
else
|
|
4100
4120
|
return v;
|
|
4101
|
-
}
|
|
4102
4121
|
};
|
|
4103
4122
|
}
|
|
4104
4123
|
let descriptor, find = data;
|
|
@@ -4525,7 +4544,12 @@ var LeaferUI = (function (exports) {
|
|
|
4525
4544
|
while (root.parent && !root.parent.leafer) {
|
|
4526
4545
|
root = root.parent;
|
|
4527
4546
|
}
|
|
4528
|
-
|
|
4547
|
+
const r = root;
|
|
4548
|
+
if (r.__fullLayouting)
|
|
4549
|
+
return;
|
|
4550
|
+
r.__fullLayouting = true;
|
|
4551
|
+
Platform.layout(r);
|
|
4552
|
+
delete r.__fullLayouting;
|
|
4529
4553
|
}
|
|
4530
4554
|
}
|
|
4531
4555
|
getTransform(relative = 'world') {
|
|
@@ -6050,7 +6074,7 @@ var LeaferUI = (function (exports) {
|
|
|
6050
6074
|
}
|
|
6051
6075
|
}
|
|
6052
6076
|
|
|
6053
|
-
const version = "1.5.
|
|
6077
|
+
const version = "1.5.2";
|
|
6054
6078
|
|
|
6055
6079
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6056
6080
|
get allowBackgroundColor() { return true; }
|
|
@@ -7483,7 +7507,7 @@ var LeaferUI = (function (exports) {
|
|
|
7483
7507
|
strokeType()
|
|
7484
7508
|
], exports.UI.prototype, "dashPattern", void 0);
|
|
7485
7509
|
__decorate([
|
|
7486
|
-
strokeType()
|
|
7510
|
+
strokeType(0)
|
|
7487
7511
|
], exports.UI.prototype, "dashOffset", void 0);
|
|
7488
7512
|
__decorate([
|
|
7489
7513
|
strokeType(10)
|
|
@@ -7576,6 +7600,12 @@ var LeaferUI = (function (exports) {
|
|
|
7576
7600
|
__decorate([
|
|
7577
7601
|
dataProcessor(GroupData)
|
|
7578
7602
|
], exports.Group.prototype, "__", void 0);
|
|
7603
|
+
__decorate([
|
|
7604
|
+
boundsType(0)
|
|
7605
|
+
], exports.Group.prototype, "width", void 0);
|
|
7606
|
+
__decorate([
|
|
7607
|
+
boundsType(0)
|
|
7608
|
+
], exports.Group.prototype, "height", void 0);
|
|
7579
7609
|
exports.Group = __decorate([
|
|
7580
7610
|
useModule(exports.Branch),
|
|
7581
7611
|
registerUI()
|
|
@@ -7991,7 +8021,7 @@ var LeaferUI = (function (exports) {
|
|
|
7991
8021
|
__updateRectBoxBounds() { }
|
|
7992
8022
|
__updateBoxBounds(_secondLayout) {
|
|
7993
8023
|
const data = this.__;
|
|
7994
|
-
if (this.children.length) {
|
|
8024
|
+
if (this.children.length && !this.pathInputed) {
|
|
7995
8025
|
if (data.__autoSide) {
|
|
7996
8026
|
if (data.__hasSurface)
|
|
7997
8027
|
this.__extraUpdate();
|
|
@@ -8060,6 +8090,12 @@ var LeaferUI = (function (exports) {
|
|
|
8060
8090
|
__decorate([
|
|
8061
8091
|
dataProcessor(BoxData)
|
|
8062
8092
|
], exports.Box.prototype, "__", void 0);
|
|
8093
|
+
__decorate([
|
|
8094
|
+
boundsType(100)
|
|
8095
|
+
], exports.Box.prototype, "width", void 0);
|
|
8096
|
+
__decorate([
|
|
8097
|
+
boundsType(100)
|
|
8098
|
+
], exports.Box.prototype, "height", void 0);
|
|
8063
8099
|
__decorate([
|
|
8064
8100
|
dataType(false)
|
|
8065
8101
|
], exports.Box.prototype, "resizeChildren", void 0);
|
|
@@ -8658,16 +8694,20 @@ var LeaferUI = (function (exports) {
|
|
|
8658
8694
|
}
|
|
8659
8695
|
|
|
8660
8696
|
function fillText(ui, canvas) {
|
|
8661
|
-
let row;
|
|
8662
|
-
const { rows, decorationY
|
|
8697
|
+
let row, data = ui.__.__textDrawData;
|
|
8698
|
+
const { rows, decorationY } = data;
|
|
8663
8699
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
8664
8700
|
row = rows[i];
|
|
8665
8701
|
if (row.text)
|
|
8666
8702
|
canvas.fillText(row.text, row.x, row.y);
|
|
8667
8703
|
else if (row.data)
|
|
8668
8704
|
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
8669
|
-
|
|
8670
|
-
|
|
8705
|
+
}
|
|
8706
|
+
if (decorationY) {
|
|
8707
|
+
const { decorationColor, decorationHeight } = data;
|
|
8708
|
+
if (decorationColor)
|
|
8709
|
+
canvas.fillStyle = decorationColor;
|
|
8710
|
+
rows.forEach(row => decorationY.forEach(value => canvas.fillRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
8671
8711
|
}
|
|
8672
8712
|
}
|
|
8673
8713
|
|
|
@@ -8738,16 +8778,18 @@ var LeaferUI = (function (exports) {
|
|
|
8738
8778
|
out.recycle(ui.__nowWorld);
|
|
8739
8779
|
}
|
|
8740
8780
|
function drawTextStroke(ui, canvas) {
|
|
8741
|
-
let row;
|
|
8742
|
-
const { rows, decorationY
|
|
8781
|
+
let row, data = ui.__.__textDrawData;
|
|
8782
|
+
const { rows, decorationY } = data;
|
|
8743
8783
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
8744
8784
|
row = rows[i];
|
|
8745
8785
|
if (row.text)
|
|
8746
8786
|
canvas.strokeText(row.text, row.x, row.y);
|
|
8747
8787
|
else if (row.data)
|
|
8748
8788
|
row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
|
|
8749
|
-
|
|
8750
|
-
|
|
8789
|
+
}
|
|
8790
|
+
if (decorationY) {
|
|
8791
|
+
const { decorationHeight } = data;
|
|
8792
|
+
rows.forEach(row => decorationY.forEach(value => canvas.strokeRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
8751
8793
|
}
|
|
8752
8794
|
}
|
|
8753
8795
|
function drawStrokesStyle(strokes, isText, ui, canvas) {
|
|
@@ -9313,6 +9355,8 @@ var LeaferUI = (function (exports) {
|
|
|
9313
9355
|
}
|
|
9314
9356
|
image.unload(paints[i].loadId, !input.some((item) => item.url === url));
|
|
9315
9357
|
}
|
|
9358
|
+
else
|
|
9359
|
+
paints[i].style = null;
|
|
9316
9360
|
}
|
|
9317
9361
|
}
|
|
9318
9362
|
return recycleMap;
|
|
@@ -10045,14 +10089,25 @@ var LeaferUI = (function (exports) {
|
|
|
10045
10089
|
}
|
|
10046
10090
|
|
|
10047
10091
|
function decorationText(drawData, style) {
|
|
10048
|
-
|
|
10092
|
+
let type;
|
|
10093
|
+
const { fontSize, textDecoration } = style;
|
|
10049
10094
|
drawData.decorationHeight = fontSize / 11;
|
|
10050
|
-
|
|
10095
|
+
if (typeof textDecoration === 'object') {
|
|
10096
|
+
type = textDecoration.type;
|
|
10097
|
+
if (textDecoration.color)
|
|
10098
|
+
drawData.decorationColor = ColorConvert.string(textDecoration.color);
|
|
10099
|
+
}
|
|
10100
|
+
else
|
|
10101
|
+
type = textDecoration;
|
|
10102
|
+
switch (type) {
|
|
10051
10103
|
case 'under':
|
|
10052
|
-
drawData.decorationY = fontSize * 0.15;
|
|
10104
|
+
drawData.decorationY = [fontSize * 0.15];
|
|
10053
10105
|
break;
|
|
10054
10106
|
case 'delete':
|
|
10055
|
-
drawData.decorationY = -fontSize * 0.35;
|
|
10107
|
+
drawData.decorationY = [-fontSize * 0.35];
|
|
10108
|
+
break;
|
|
10109
|
+
case 'under-delete':
|
|
10110
|
+
drawData.decorationY = [fontSize * 0.15, -fontSize * 0.35];
|
|
10056
10111
|
}
|
|
10057
10112
|
}
|
|
10058
10113
|
|
|
@@ -10277,6 +10332,7 @@ var LeaferUI = (function (exports) {
|
|
|
10277
10332
|
exports.getMatrixData = getMatrixData;
|
|
10278
10333
|
exports.getPointData = getPointData;
|
|
10279
10334
|
exports.hitType = hitType;
|
|
10335
|
+
exports.isEmptyData = isEmptyData;
|
|
10280
10336
|
exports.isNull = isNull;
|
|
10281
10337
|
exports.layoutProcessor = layoutProcessor;
|
|
10282
10338
|
exports.maskType = maskType;
|