Skip to content
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

Add partial selection support #7

Closed
msnspk opened this issue May 30, 2021 · 3 comments
Closed

Add partial selection support #7

msnspk opened this issue May 30, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@msnspk
Copy link

msnspk commented May 30, 2021

Feature/enhancement description:

It's a common feature in CAD software to be able to select elements based on "partial" or "total" selection.

In FreeCAD, dragging the selection rectangle from right-to-left will only select elements that are entirely contained within the selection rectangle.

However, dragging the selection rectangle from left-to-right will select any element entirely or partially contained in, or "touched" by, the selection rectangle.

Having this sort of functionality for the selection rectangle would be very useful and more powerful than how it currently operates.

If, for example, I have two overlapping elements, one larger than the other, it can be difficult if not impossible to select the larger element without selecting the smaller element as well using the current selection tool, but "partial" selection makes this very easy.

(Also, I don't want to create a separate issue for it, but it currently seems impossible to select an element by simply clicking on the stroke. It seems you have to select it inside the rectangle. So, that's another minor enhancement that would be nice to have.)

Thanks for developing this software! I'm already using it almost every day as a replacement for Milton, and it works very well. I'm not sure if I explained this feature very clearly, so please ask questions if you have any.

@msnspk msnspk added the enhancement New feature or request label May 30, 2021
@mbrlabs
Copy link
Owner

mbrlabs commented May 30, 2021

Hey, thanks for already using it :)

Currently in order to select a brush stroke you will have to select both the first and the last point of the stroke. This is also why just clicking on a stroke won't work. This has been implemented like that by @fenix-hub mainly because it's really fast to do it like that (and it works pretty well i think). In order to implement partial selection you would have to check every point of every brush stroke. This can be improved by only testing the brush strokes currently on screen strating with the ones closest to the cursor however.

Certainly a useful thing to have but something for the future i think. I'll have to figure out how to best implement it performance and UX wise.

@mbrlabs
Copy link
Owner

mbrlabs commented Jul 21, 2021

I finally got around to start implementing this in 7344dd6. For now it's just the partial selection (no matter how you drag the selection rectangle). It's really much more usable like that!

Performance is actually really good. I only test strokes that are on screen and with those i do a "broad-phase" collision check first by checking if bounding boxes intersect. Only then do i actually check if individual points are in the seletion rectangle.

I will leave this issue open, since i want to eventually implement the traditional (whole stroke selected) selection method as well. But i'm unsure if the dragging from left/right is the right approch...it might confuse people because it makes the tool behave differently.

@mbrlabs
Copy link
Owner

mbrlabs commented Nov 6, 2023

Finally closing this, as i think the current partial selection support is sufficient

@mbrlabs mbrlabs closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants