Page 1 of 1

[kovarex] [0.17.32] LuaGuiElement.caption not updating correctly

Posted: Sat Apr 20, 2019 10:55 am
by Choumiko
Setting the caption for a label to "" doesn't always update the GUI:

Screenshot from 2019-04-20 12-42-33.png
Screenshot from 2019-04-20 12-42-33.png (17.29 KiB) Viewed 1369 times

clicking the clear button should set the labels to be displayed as empty, actual result:
Screenshot from 2019-04-20 12-43-18.png
Screenshot from 2019-04-20 12-43-18.png (13.84 KiB) Viewed 1369 times

It seems like if a label has style.width AND style.height defined, setting the caption to "" doesn't update the display.
Setting the caption to any other string works as expected for all 3 labels

To reproduce: start new game with attached mod, click the clear button

When it get's fixed, could you explain what was wrong? This seems like such a strange thing to happen :mrgreen:

Re: [kovarex] [0.17.32] LuaGuiElement.caption not updating correctly

Posted: Tue Apr 30, 2019 1:12 pm
by kovarex
Thanks for the report, it is fixed for the next version now.

All the variants didn't clear its internal data, but the bug was only visible on the last one. Why?

Because when drawing widgets, we only draw those, that have intersection with the current clipping rectangle. This is an optimisation so things are not drown in scrollable area when out of the view
By an (lucky) accident and definition, any area with surface 0 (so when width is 0 or height is 0) has always no intersection with any rectangle you give it, so widgets with this size are never rendered.