-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor offset for highlighted blocks in HighlightTextArea wrong #306
Comments
Looks like this is an issue with kerning. X offset of highlight is calculated only on the highlighted text itself while cursor is using glyph positions calculated on the entire text. Unfortunately I'm not seeing an easy fix for this. By the way, in your regex you can use |
Is there any way to work around this then? Maybe use a diffrent font or something? Thanks for the tip with ^, I am already using that somewhere else and just didnt change it in this example. |
You can try using any monospaced font. They don't use kerning and it should work better in general for code-type stuff. Or you can drop the rule for |
If I have multible Highlighted areas in a HighlightTextArea on the same line, the cursor position gets offset to the left a bit more per block.
Code Example for reproduction: https://pastebin.com/vnYv9qg2
Used Java version: JavaSE11
used libGDX version: 1.9.9 with lwjgl3 backend
Used visUI version: 1.4.2
In the attached screenshot you can see that the cursor is offset way off to the right even tho the cursor position is at the end of the line which is right behind the word "false" (there are no spaces after that).
The text was updated successfully, but these errors were encountered: