-
Notifications
You must be signed in to change notification settings - Fork 43
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
Inaccurate text selection #197
Comments
This can have to do with "snap to grid" switched on. In this setting FidoCadJ can only make a selection from grid point to grid point. This also includes that objects close to each other are chosen because one of their grid points are within the selection. |
I'm working on the problem, and it seems to mainly involve short texts, with a single character, although in some cases, even with two characters (besides the index or exponent, I mean). This is an example for the tests:
With certain fonts like Arial and Arial Black, the problem doesn't seem to occur. I’m continuing to study the problem. I’ve tried modifying the "getDistanceToPoint()" function in various ways, but with little success. |
Okay, I think I've figured it out. The problem lies in the handling of tokens for subscripts and superscripts, which cause the string to lengthen as if spaces were added. As a result, the bounding box is not correct.
For texts that are very close together, the result is that the bounding boxes overlap, creating a selection problem. |
I forced the drawing of the bounding boxes on the texts. As you can see, the problem becomes clear: @DarwinNE, this was a feature you integrated in the latest release "0.24.8," because I tried it on "0.24.7," and it wasn't implemented. Correct? I was wondering why you didn't use the "TextAttribute," but thinking about it, I believe the reason is related to minimizing the use of AWT as much as possible... |
Superscripts and index are a feature added in 0.24.8. |
The problem lies in the The idea would be:
I would also like to implement some upstream limitations that check the following: Trimming Input Strings: Check for Consecutive Control Characters: |
I don't think there's any point in having empty spaces at the beginning and end of a text; it can only cause alignment issues, at least that's how I see it.
You're right, so the check would only be done if there are control characters (one or more) with nothing else after them. What do you think? |
For now, I've had to park it in a local branch. I'm currently focusing on theme integration. I'll get back to it in a few days once I've cooled off a bit. ;-I |
If the string does not contain any error, why shall we change it? |
But wouldn't something like this be classified as an error?
|
No, it is not an error by itself. |
The only side effect at the moment is that it increases the bounding box of the text; each control character or space causes it to grow. |
Hi @DarwinNE
I found a problem with FidoCadJ 0.24.8.
From this code
you get this picture:
Now, if you try to select the text , pointing to the red dot (image below), in reality you select the text .
To select the text , you must point the cursor on the green point.
I hope I have been sufficiently clear ;)
Bye, Max
The text was updated successfully, but these errors were encountered: