@leafer-ui/worker 1.4.1 → 1.5.0
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 +6 -5
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.esm.js +6 -5
- 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 +34 -27
- 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 +34 -27
- 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 +10 -10
package/dist/worker.cjs
CHANGED
|
@@ -2143,13 +2143,14 @@ function toChar(data, charX, rowData, isOverflow) {
|
|
|
2143
2143
|
}
|
|
2144
2144
|
|
|
2145
2145
|
function layoutText(drawData, style) {
|
|
2146
|
-
const { rows, bounds } = drawData;
|
|
2146
|
+
const { rows, bounds } = drawData, countRows = rows.length;
|
|
2147
2147
|
const { __lineHeight, __baseLine, __letterSpacing, __clipText, textAlign, verticalAlign, paraSpacing, autoSizeAlign } = style;
|
|
2148
|
-
let { x, y, width, height } = bounds, realHeight = __lineHeight *
|
|
2148
|
+
let { x, y, width, height } = bounds, realHeight = __lineHeight * countRows + (paraSpacing ? paraSpacing * (drawData.paraNumber - 1) : 0);
|
|
2149
2149
|
let starY = __baseLine;
|
|
2150
2150
|
if (__clipText && realHeight > height) {
|
|
2151
2151
|
realHeight = Math.max(height, __lineHeight);
|
|
2152
|
-
|
|
2152
|
+
if (countRows > 1)
|
|
2153
|
+
drawData.overflow = countRows;
|
|
2153
2154
|
}
|
|
2154
2155
|
else if (height || autoSizeAlign) {
|
|
2155
2156
|
switch (verticalAlign) {
|
|
@@ -2161,7 +2162,7 @@ function layoutText(drawData, style) {
|
|
|
2161
2162
|
}
|
|
2162
2163
|
starY += y;
|
|
2163
2164
|
let row, rowX, rowWidth, layoutWidth = (width || autoSizeAlign) ? width : drawData.maxWidth;
|
|
2164
|
-
for (let i = 0, len =
|
|
2165
|
+
for (let i = 0, len = countRows; i < len; i++) {
|
|
2165
2166
|
row = rows[i];
|
|
2166
2167
|
row.x = x;
|
|
2167
2168
|
if (row.width < width || (row.width > width && !__clipText)) {
|
|
@@ -2230,7 +2231,7 @@ function clipText(drawData, style, x, width) {
|
|
|
2230
2231
|
if (i === end && charRight < right) {
|
|
2231
2232
|
break;
|
|
2232
2233
|
}
|
|
2233
|
-
else if (charRight < right && char.char !== ' ') {
|
|
2234
|
+
else if ((charRight < right && char.char !== ' ') || !i) {
|
|
2234
2235
|
row.data.splice(i + 1);
|
|
2235
2236
|
row.width -= char.width;
|
|
2236
2237
|
break;
|