leafer-ui 1.4.2 → 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/README.md +13 -5
- package/dist/web.cjs +6 -5
- package/dist/web.cjs.map +1 -1
- package/dist/web.esm.js +6 -5
- 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 +25 -19
- 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 +25 -19
- 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.esm.js
CHANGED
|
@@ -2634,13 +2634,14 @@ function toChar(data, charX, rowData, isOverflow) {
|
|
|
2634
2634
|
}
|
|
2635
2635
|
|
|
2636
2636
|
function layoutText(drawData, style) {
|
|
2637
|
-
const { rows, bounds } = drawData;
|
|
2637
|
+
const { rows, bounds } = drawData, countRows = rows.length;
|
|
2638
2638
|
const { __lineHeight, __baseLine, __letterSpacing, __clipText, textAlign, verticalAlign, paraSpacing, autoSizeAlign } = style;
|
|
2639
|
-
let { x, y, width, height } = bounds, realHeight = __lineHeight *
|
|
2639
|
+
let { x, y, width, height } = bounds, realHeight = __lineHeight * countRows + (paraSpacing ? paraSpacing * (drawData.paraNumber - 1) : 0);
|
|
2640
2640
|
let starY = __baseLine;
|
|
2641
2641
|
if (__clipText && realHeight > height) {
|
|
2642
2642
|
realHeight = Math.max(height, __lineHeight);
|
|
2643
|
-
|
|
2643
|
+
if (countRows > 1)
|
|
2644
|
+
drawData.overflow = countRows;
|
|
2644
2645
|
}
|
|
2645
2646
|
else if (height || autoSizeAlign) {
|
|
2646
2647
|
switch (verticalAlign) {
|
|
@@ -2652,7 +2653,7 @@ function layoutText(drawData, style) {
|
|
|
2652
2653
|
}
|
|
2653
2654
|
starY += y;
|
|
2654
2655
|
let row, rowX, rowWidth, layoutWidth = (width || autoSizeAlign) ? width : drawData.maxWidth;
|
|
2655
|
-
for (let i = 0, len =
|
|
2656
|
+
for (let i = 0, len = countRows; i < len; i++) {
|
|
2656
2657
|
row = rows[i];
|
|
2657
2658
|
row.x = x;
|
|
2658
2659
|
if (row.width < width || (row.width > width && !__clipText)) {
|
|
@@ -2721,7 +2722,7 @@ function clipText(drawData, style, x, width) {
|
|
|
2721
2722
|
if (i === end && charRight < right) {
|
|
2722
2723
|
break;
|
|
2723
2724
|
}
|
|
2724
|
-
else if (charRight < right && char.char !== ' ') {
|
|
2725
|
+
else if ((charRight < right && char.char !== ' ') || !i) {
|
|
2725
2726
|
row.data.splice(i + 1);
|
|
2726
2727
|
row.width -= char.width;
|
|
2727
2728
|
break;
|