[Wheybags] [0.17.77] changing style.font for textfields does not cause redrawing
Posted: Fri Nov 15, 2019 2:44 am
When changing the font of a textfield after it has already been drawn, the text does not get redrawn with the new font until something else causes it to redraw (like after the user types a character for example).
(one can also say "the change has no effect - yet", "it is delayed")
yes, happens reliably every time.
(expected: the font should update instantly)
steps to reproduce:
1. create a new world
2. run
3. then in a later tick run
4. press control + f6
5. hover over the text box, it shows font "default-bold", but visually is "default"
6. focus the textfield
7. remove 1 char
8. the font changes visually to "default-bold"
alternatively, after 5. run
(does not change the font visually)
then run
(does change it, because it's a different text)
or
works too
state at step 5.:
state at end:
(one can also say "the change has no effect - yet", "it is delayed")
yes, happens reliably every time.
(expected: the font should update instantly)
steps to reproduce:
1. create a new world
2. run
Code: Select all
/c
game.player.gui.screen
.add{type = "frame", name = "demo", caption = "demo"}
.add{type = "textfield", name = "tf", text = "text"}
Code: Select all
/c game.player.gui.screen.demo.tf.style.font = "default-bold"
5. hover over the text box, it shows font "default-bold", but visually is "default"
6. focus the textfield
7. remove 1 char
8. the font changes visually to "default-bold"
alternatively, after 5. run
Code: Select all
/c game.player.gui.screen.demo.tf.text = "text"
then run
Code: Select all
/c game.player.gui.screen.demo.tf.text = "tex"
or
Code: Select all
/c game.player.gui.screen.demo.tf.style.color = {1, 0, 0}
state at step 5.:
state at end: