@leafer-ui/text 1.0.0-beta.7 → 1.0.0-beta.8

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": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "@leafer-ui/text",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,10 +19,10 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer-ui/core": "1.0.0-beta.7"
22
+ "@leafer-ui/core": "1.0.0-beta.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@leafer/interface": "1.0.0-beta.7",
26
- "@leafer-ui/interface": "1.0.0-beta.7"
25
+ "@leafer/interface": "1.0.0-beta.8",
26
+ "@leafer-ui/interface": "1.0.0-beta.8"
27
27
  }
28
28
  }
package/src/TextLayout.ts CHANGED
@@ -53,6 +53,8 @@ export function layoutText(drawData: ITextDrawData, style: ITextData): void {
53
53
  row.isOverflow = true
54
54
  drawData.overflow = i + 1
55
55
  }
56
+
57
+ if (row.width > bounds.width) bounds.width = row.width
56
58
  }
57
59
 
58
60
  bounds.y = y
package/src/TextRows.ts CHANGED
@@ -23,7 +23,7 @@ export function createRows(drawData: ITextDrawData, content: string, style: ITex
23
23
  const { __letterSpacing, paraIndent, textCase } = style
24
24
  const { canvas } = Platform
25
25
  const { width, height } = bounds
26
- const charMode = width || height || __letterSpacing || textCase
26
+ const charMode = width || height || __letterSpacing || (textCase !== 'none')
27
27
 
28
28
  if (charMode) {
29
29
 
@@ -136,9 +136,8 @@ function addRow(): void {
136
136
  paraStart = false
137
137
  }
138
138
  row.width = rowWidth
139
- trimRight(row)
139
+ if (bounds.width) trimRight(row)
140
140
  rows.push(row)
141
- if (row.width > bounds.width) bounds.width = row.width
142
141
  row = { words: [] }
143
142
  rowWidth = 0
144
143
  }