kotcrab/vis-ui

Square Brackets in VisTextField are causing java.lang.IndexOutOfBoundsException

Rakantor opened this issue · 3 comments

Whenever typing [] into a VisTextField it results in an exception as seen below:

Exception in thread "main" java.lang.IndexOutOfBoundsException: index can't be >= size: 3 >= 3 at com.badlogic.gdx.utils.FloatArray.get(FloatArray.java:131) at com.kotcrab.vis.ui.widget.VisTextField.drawCursor(VisTextField.java:411) at com.kotcrab.vis.ui.widget.VisTextField.draw(VisTextField.java:372) at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:123) at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57) at com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.draw(WidgetGroup.java:170) at com.badlogic.gdx.scenes.scene2d.ui.Table.draw(Table.java:119) at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110) at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57) at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:128) at myproject.UserInterface.render(UserInterface.java:151) at com.badlogic.gdx.Game.render(Game.java:46) at myproject.Core.render(Core.java:69) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:399) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:137) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:111) at myproject.desktop.DesktopLauncher.main(DesktopLauncher.java:20)

Tested in 2 different projects to confirm it's not a project specific issue.
Using latest 1.4.5-SNAPSHOT build but also happened in previous versions.

I can't reproduce this. You may be using font with markupEnabled set to true. This is not supported. See Color Markup Language.

Yes I'm using Color Markup Language. I didn't know it's not supported, thanks for the information. Are there plans to add support for it in the near future?

No, this isn't going to be supported. I don't think libGDX supports it either. VisUI only provides HighlightTextArea as an alternative.