(sz math32.Vector2)
| 1808 | } |
| 1809 | |
| 1810 | func (tf *TextField) configTextSize(sz math32.Vector2) math32.Vector2 { |
| 1811 | st := &tf.Styles |
| 1812 | txs := &st.Text |
| 1813 | fs := st.FontRender() |
| 1814 | st.Font = paint.OpenFont(fs, &st.UnitContext) |
| 1815 | txt := tf.editText |
| 1816 | if tf.NoEcho { |
| 1817 | txt = concealDots(len(tf.editText)) |
| 1818 | } |
| 1819 | align, alignV := txs.Align, txs.AlignV |
| 1820 | txs.Align, txs.AlignV = styles.Start, styles.Start // only works with this |
| 1821 | tf.renderAll.SetRunes(txt, fs, &st.UnitContext, txs, true, 0, 0) |
| 1822 | tf.renderAll.Layout(txs, fs, &st.UnitContext, sz) |
| 1823 | txs.Align, txs.AlignV = align, alignV |
| 1824 | rsz := tf.renderAll.BBox.Size().Ceil() |
| 1825 | return rsz |
| 1826 | } |
| 1827 | |
| 1828 | func (tf *TextField) iconsSize() math32.Vector2 { |
| 1829 | var sz math32.Vector2 |
no test coverage detected