Closed pspeed42 closed 8 years ago
Label gets a new stylable attribute that lets you set the maximum width of a label.
Lemur layout follow a simple two pass approach: 1) calculate preferred size, 2) layout the components based on actual size. This doesn't give components a chance to change one size because another was constrained... of course, it also avoids the massive iteration that must happen to resolve those situations. It also avoids having to detect which constraints are unsolvable.
Setting the max width of a label is a way around the issue as it it's a good indicator that the label should wrap at a certain width. Vertical sizing can then be properly calculated as part of preferred size calculation.
For some reason a panel is not resizing itself when text contains multiple lines. They end up overlapping: http://hub.jmonkeyengine.org/t/lemur-multiple-multiline-text-blocks/35347
I was pretty sure the layout would be revalidated when text changes but it needs to be checked. Could be related to the layout used.
It's related to how Label interacts with BitmapText to determine preferred size. We clear the text box constraints to determine preferred size but then if the size is constrained we don't re-evaluate the height. Actually there may be no good way to do that... but I'll check.
Here is a full example that illustrates the issue: