(
text: TextStyleProps['text'],
font?: TextStyleProps['font'],
align?: TextStyleProps['align'],
verticalAlign?: TextStyleProps['verticalAlign'],
padding?: TextStyleProps['padding'],
rich?: TextStyleProps['rich'],
truncate?: boolean,
lineHeight?: number
)
| 21 | |
| 22 | type TextStyleProps = Text['style']; |
| 23 | export function getTextRect( |
| 24 | text: TextStyleProps['text'], |
| 25 | font?: TextStyleProps['font'], |
| 26 | align?: TextStyleProps['align'], |
| 27 | verticalAlign?: TextStyleProps['verticalAlign'], |
| 28 | padding?: TextStyleProps['padding'], |
| 29 | rich?: TextStyleProps['rich'], |
| 30 | truncate?: boolean, |
| 31 | lineHeight?: number |
| 32 | ) { |
| 33 | const textEl = new Text({ |
| 34 | style: { |
| 35 | text, |
| 36 | font, |
| 37 | align, |
| 38 | verticalAlign, |
| 39 | padding, |
| 40 | rich, |
| 41 | overflow: truncate ? 'truncate' : null, |
| 42 | lineHeight |
| 43 | } |
| 44 | }); |
| 45 | |
| 46 | return textEl.getBoundingRect(); |
| 47 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…