Layout Library extremely slow? #4858
Replies: 1 comment
-
Posted at 2022-06-21 by Sir_Indy You're correct that The second is, if you give the items you want to change in your layout an
This doesn't change the size, or change any other items, so it's much faster. Hope that helps! Posted at 2022-06-21 by RaoulDuke This kind of works, but the values will always be center-aligned. I have some fields that have 1-5 digits and would like them aligned to the right of their window. Posted at 2022-06-28 by @gfwilliams Interesting about the font alignment - what you suggest with setFontAlign makes a lot of sense! But yes, updating the layout is pretty slow. I've tried to improve things (and have recently moved to a minified Layout which should improve things more) but if anyone spots anything that would improve matters PRs are very welcome :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-06-20 by RaoulDuke
I have a layout that displays five labels and a bar graph. I would like to update several times per second, but Layout.update takes about 0.22s to complete. Is this normal? Changing fonts from vector to bitmap did not change anything.
As a workaround i just use g.clear() and redraw the layout completely in 0.12s. This way, i can call Layout.update just once, but then text alignments are messed up. Turns out layout uses update to calculate the position and size of a text label, then draws the text centered into it.
I think layout should use g.setFontAlign with the correct alignment to align the labels, one call to layout.update would then be enough for many apps (where you usually don´t want your layout to change because a number is now two instead of one digit).
Beta Was this translation helpful? Give feedback.
All reactions