File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
packages/imgui/src/components Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
import type { Fn , Maybe } from "@thi.ng/api" ;
2
2
import { isPlainObject } from "@thi.ng/checks/is-plain-object" ;
3
+ import { text } from "@thi.ng/geom/text" ;
3
4
import type { IGridLayout , LayoutBox } from "@thi.ng/layout" ;
4
5
import type { ReadonlyVec } from "@thi.ng/vectors" ;
5
6
import type { Color , GUITheme } from "../api.js" ;
@@ -16,19 +17,20 @@ export const textLabel = (
16
17
const theme = gui . theme ;
17
18
const { x, y, h } = layoutBox ( layout ) ;
18
19
gui . draw &&
19
- gui . add ( [
20
- "text" ,
21
- { fill : gui . textColor ( false ) } ,
22
- [ x + ( pad ? theme . pad : 0 ) , y + h / 2 + theme . baseLine ] ,
23
- label ,
24
- ] ) ;
20
+ gui . add (
21
+ text (
22
+ [ x + ( pad ? theme . pad : 0 ) , y + h / 2 + theme . baseLine ] ,
23
+ label ,
24
+ { fill : gui . textColor ( false ) }
25
+ )
26
+ ) ;
25
27
} ;
26
28
27
29
export const textLabelRaw = (
28
30
p : ReadonlyVec ,
29
31
attribs : Color | any ,
30
32
label : string
31
- ) => [ " text" , isPlainObject ( attribs ) ? attribs : { fill : attribs } , p , label ] ;
33
+ ) => text ( p , label , isPlainObject ( attribs ) ? attribs : { fill : attribs } ) ;
32
34
33
35
export const textTransformH = (
34
36
theme : GUITheme ,
You can’t perform that action at this time.
0 commit comments