@leafer-ui/text 2.0.0 → 2.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/text",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "@leafer-ui/text",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "2.0.0"
25
+ "@leafer/core": "2.0.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "2.0.0",
29
- "@leafer-ui/interface": "2.0.0"
28
+ "@leafer/interface": "2.0.1",
29
+ "@leafer-ui/interface": "2.0.1"
30
30
  }
31
31
  }
package/src/TextClip.ts CHANGED
@@ -4,11 +4,12 @@ import { ITextCharData, ITextData, ITextDrawData, ITextRowData } from '@leafer-u
4
4
 
5
5
 
6
6
  export function clipText(drawData: ITextDrawData, style: ITextData, x: number, width: number): void {
7
- if (!width) return
8
7
 
9
8
  const { rows, overflow } = drawData
10
9
  let { textOverflow } = style
11
- rows.splice(overflow)
10
+ if (overflow) rows.splice(overflow)
11
+
12
+ if (!width) return
12
13
 
13
14
  if (textOverflow && textOverflow !== 'show') {
14
15
  if (textOverflow === 'hide') textOverflow = ''
package/src/TextLayout.ts CHANGED
@@ -12,7 +12,7 @@ export function layoutText(drawData: ITextDrawData, style: ITextData): void {
12
12
  // verticalAlign
13
13
 
14
14
  if (__clipText && realHeight > height) {
15
- realHeight = Math.max(height, __lineHeight)
15
+ realHeight = Math.max(style.__autoHeight ? realHeight : height, __lineHeight)
16
16
  if (countRows > 1) drawData.overflow = countRows
17
17
  } else if (height || autoSizeAlign) {
18
18
  switch (verticalAlign) {