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

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

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

Post 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 2073 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 2073 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:
log
Attachments
TestModGui_3.0.0.zip
(1.84 KiB) Downloaded 112 times

kovarex
Factorio Staff
Factorio Staff
Posts: 8193
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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.

Post Reply

Return to “Resolved Problems and Bugs”