I have an application where the label grows as more text it has, yes it looks bad, so we can just remove text from it. But the automatically evened size becomes negative and it crashes.
I wonder if there could have some way to prevent it, like set a minimum for all elements to never become negative?
On the test case, just click any button, the textfield text will be copied to the label and it will crash. If you hit backspace before clicking (one less letter), it will not crash.
java.lang.IllegalArgumentException: Size cannot be negative:(-0.25321198, 0.0, 0.0)
at com.simsilica.lemur.core.GuiControl.setSize(GuiControl.java:242)
at com.simsilica.lemur.component.SpringGridLayout$Entry.setSize(SpringGridLayout.java:537)
at com.simsilica.lemur.component.SpringGridLayout.reshape(SpringGridLayout.java:310)
at com.simsilica.lemur.core.GuiControl.setSize(GuiControl.java:259)
at com.simsilica.lemur.core.GuiControl.revalidate(GuiControl.java:351)
at com.simsilica.lemur.core.GuiControl.controlUpdate(GuiControl.java:318)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:112)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:661)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:808)
at com.jme3.scene.Node.updateLogicalState(Node.java:222)
at com.jme3.scene.Node.updateLogicalState(Node.java:233)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:250)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)
Test case: