-
Notifications
You must be signed in to change notification settings - Fork 42
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
Distinctive selection in AutoCAD style #236
Comments
Hi @manufino, Cheers, |
@DarwinNE, I've already completed and tested it (at least on my end), but I'm stuck with the pull requests due to conflicts. |
This implementation is included in my pull request #240 |
I am checking the code you added in the recent pull request. Nice work. I noticed it seems that sometimes there are some redrawing issues. Probably the definition of the "dirty" part of the redraw area is not correct in same situations. Here is what I obtain by moving the mouse alternatively from one kind of selection style to another one: |
Very strange, this doesn't happen on my system. |
Could this be the solution? on "CircuitPanel": /** Determine the direction of the selection.
@param isLeftToRight True if the direction is from left to right..
False if it is from right to left.
*/
public void isLeftToRightSelection(boolean isLeftToRight)
{
if(isLeftToRight) {
this.selectionColor = Color.BLUE;
} else {
this.selectionColor = Color.GREEN;
}
// Force the redraw when the selection direction changes.
this.repaint();
} |
It seems to work. You may also see if you can declare only a certain section of the image as "dirty", only the "dirty" region will be repainted. This is usually a faster strategy rather than repainting the whole component. But we will be dealing with the optimizations later (if needed), the important thing is that the code now works. On another point, I noticed a certain difficulty to handle the spline in this case:
|
@DarwinNE, Can you explain the problem you're encountering in more detail? **Edit: |
Exactly, in many case it is impossible to select correctly the spline. |
Okay, I understand the problem. I'm working on it. |
@DarwinNE, Okay, I should have fixed everything. It was a major oversight that prevented proper selection. |
Now it seems to be working as charm, thank you! Another situation that is very tricky to handle is text with index and exponents. BTW, it would be possible to use the green color for the "integral" selection (that is the "historic" strategy adopted by FidoCadJ) and the blue color for the "partial" selection. |
Good.
I'll try to thoroughly check the text handling; let's see if I can find a solution.
It's already like that. The right-to-left selection is the classic one; it has just been improved. Now it recognizes all parts of the primitives, whereas before, only the vertices were considered. As for the left-to-right selection (the blue one), it selects only and EXCLUSIVELY the primitives that are COMPLETELY contained within the selection rectangle. Or maybe I didn't understand what you meant... |
It's another tricky problem. FidoCadJ 0.24.8 worked "sufficiently well" with the text, but it was far from perfect. If you like to work on such kinds of problems and you see a way to improve things, do not hesitate.
I checked comparing with FidoCadJ 0.24.8 and I think you are right. It makes sense to leave things as you did.
I'd like to add a small message in the text area to fully discriminate between the two. By the way, if you have terms for an Italian translation, I'm interested, too :-) |
I've been working on this all evening; it's a pretty tricky problem to solve, but I think I can manage it. I'm doing a lot of debugging to figure out how to proceed.
Yes, nice, I like them.
Yes, good idea. Can you take care of it?
I don't know; I've never been good at communication science ;-)
|
With pleasure. I'll work on this between today and tomorrow. |
I added the messages. This required some refactoring around the various controllers, listeners etc.
I hope this jargon would make sense, if there is room for improvement let me know. I translated it in French and Italian and opened the other issues associated to the different translations (hoping that someone can do the work). EDIT: I corrected my confusion, that @manufino pointed out in the following message. |
@DarwinNE, maybe you meant:
|
You are right, I corrected. |
@DarwinNE, I've tested everything thoroughly and fixed the last details; this can be closed as well. |
I have already implemented this feature, also improving the selection system for primitives, which can now be selected by grabbing even a small part of them, not just through the handles.
Here you can find documentation regarding this:
https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-243E4DD0-8947-4905-AFE2-BE9B903A8C3F
I had to implement an "intersects" method on all primitives to perform an accurate selection process.
The most challenging were the "PrimitiveComplexCurve" and "PrimitiveBezier" classes, where I had to implement specific selective algorithms.
This implementation also involved other classes to manage the selection method.
The text was updated successfully, but these errors were encountered: