configTextSize does the HTML and Layout in paintText for text, using given size to constrain layout.
(sz math32.Vector2)
| 292 | // configTextSize does the HTML and Layout in paintText for text, |
| 293 | // using given size to constrain layout. |
| 294 | func (tx *Text) configTextSize(sz math32.Vector2) { |
| 295 | // todo: last arg is CSSAgg. Can synthesize that some other way? |
| 296 | fs := tx.Styles.FontRender() |
| 297 | txs := &tx.Styles.Text |
| 298 | tx.paintText.SetHTML(tx.Text, fs, txs, &tx.Styles.UnitContext, nil) |
| 299 | tx.paintText.Layout(txs, fs, &tx.Styles.UnitContext, sz) |
| 300 | } |
| 301 | |
| 302 | // configTextAlloc is used for determining how much space the text |
| 303 | // takes, using given size (typically Alloc). |
no test coverage detected