@leafer-ui/display 1.0.0-rc.7 → 1.0.0-rc.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 +8 -8
- package/src/Text.ts +3 -3
- package/src/UI.ts +1 -1
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.8",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.0.0-rc.
|
|
26
|
-
"@leafer-ui/data": "1.0.0-rc.
|
|
27
|
-
"@leafer-ui/display-module": "1.0.0-rc.
|
|
28
|
-
"@leafer-ui/decorator": "1.0.0-rc.
|
|
29
|
-
"@leafer-ui/external": "1.0.0-rc.
|
|
25
|
+
"@leafer/core": "1.0.0-rc.8",
|
|
26
|
+
"@leafer-ui/data": "1.0.0-rc.8",
|
|
27
|
+
"@leafer-ui/display-module": "1.0.0-rc.8",
|
|
28
|
+
"@leafer-ui/decorator": "1.0.0-rc.8",
|
|
29
|
+
"@leafer-ui/external": "1.0.0-rc.8"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.0.0-rc.
|
|
33
|
-
"@leafer-ui/interface": "1.0.0-rc.
|
|
32
|
+
"@leafer/interface": "1.0.0-rc.8",
|
|
33
|
+
"@leafer-ui/interface": "1.0.0-rc.8"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Text.ts
CHANGED
|
@@ -123,7 +123,7 @@ export class Text extends UI implements IText {
|
|
|
123
123
|
|
|
124
124
|
const data = this.__
|
|
125
125
|
const layout = this.__layout
|
|
126
|
-
const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow } = data
|
|
126
|
+
const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow, padding } = data
|
|
127
127
|
|
|
128
128
|
const autoWidth = data.__autoWidth
|
|
129
129
|
const autoHeight = data.__autoHeight
|
|
@@ -132,6 +132,7 @@ export class Text extends UI implements IText {
|
|
|
132
132
|
|
|
133
133
|
data.__lineHeight = UnitConvert.number(lineHeight, fontSize)
|
|
134
134
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize)
|
|
135
|
+
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined
|
|
135
136
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2
|
|
136
137
|
data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`
|
|
137
138
|
data.__clipText = textOverflow !== 'show' && !data.__autoBounds
|
|
@@ -149,9 +150,8 @@ export class Text extends UI implements IText {
|
|
|
149
150
|
b.width = autoWidth ? bounds.width : data.width
|
|
150
151
|
b.height = autoHeight ? bounds.height : data.height
|
|
151
152
|
|
|
152
|
-
const { padding } = data
|
|
153
153
|
if (padding) {
|
|
154
|
-
const [top, right, bottom, left] =
|
|
154
|
+
const [top, right, bottom, left] = data.__padding
|
|
155
155
|
if (autoWidth) {
|
|
156
156
|
b.x -= left
|
|
157
157
|
b.width += (right + left)
|
package/src/UI.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class UI extends Leaf implements IUI {
|
|
|
19
19
|
@dataProcessor(UIData)
|
|
20
20
|
declare public __: IUIData
|
|
21
21
|
|
|
22
|
-
declare public proxyData
|
|
22
|
+
declare public proxyData: IUIInputData // need rewrite getter
|
|
23
23
|
declare public __proxyData?: IUIInputData
|
|
24
24
|
|
|
25
25
|
public get app(): ILeafer { return this.leafer && this.leafer.app }
|
package/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IEditSize, IFi
|
|
|
4
4
|
|
|
5
5
|
declare class UI extends Leaf implements IUI {
|
|
6
6
|
__: IUIData;
|
|
7
|
-
proxyData
|
|
7
|
+
proxyData: IUIInputData;
|
|
8
8
|
__proxyData?: IUIInputData;
|
|
9
9
|
get app(): ILeafer;
|
|
10
10
|
leafer?: ILeafer;
|