-
Notifications
You must be signed in to change notification settings - Fork 130
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
[VisUi] VisTextfield + FloatDigitsOnlyFilter copy & paste missing decimal point (and minus sign) #131
Comments
Thanks for reporting, I added some additional logic that ignores selected text which will be replaced when user types or pastes something. |
Great. However this introduced another bug:
I just created a new filter with your fix for testing this out. Here is the stacktrace:
That's line 38 in your FloatDigitsOnlyFilter.java: |
I noticed similar crash right after I committed and made some additional changes in next commit which you probably didn't saw: aa98674. It fixes this. |
Yes, didn't see that. Thanks for the fix! |
No problem. Btw Mundus looks pretty nice ;) |
Thank you ;) |
Hi Kotcrab,
first of all thanks for that great UI extension ;)
So i noticed a little bug. I have a VisTextField, and attach a FloatDigitsOnlyFilter to it. Then i type some random floating point number and copy in that same field annother floating point number. Then the decimal point is not pasted..only the digits.
So for example if i have 0.1234 in my clipboard but there is already a floating point number in the field, the pasted float becomes 01234. The same goes for the minus sign.
As for the point, the problem lies in the acceptChar() method of the filter:
https://github.com/kotcrab/VisEditor/blob/b2ea63a045e805099ddd16778517d46d2419a637/UI/src/com/kotcrab/vis/ui/util/FloatDigitsOnlyFilter.java
If there is already a floating point number in the field this is not going to work:
Unfortunately i don't know how this can be fixed.
The text was updated successfully, but these errors were encountered: