Skip to content

Add ability to start lasso select within object without dragging layers #2799

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

Closed

Conversation

hemu
Copy link
Contributor

@hemu hemu commented Jun 29, 2025

When beginning a lasso select from within an object, currently the behavior is to drag its layers. This PR updates this behavior such that a lasso select beginning within an object will remain a lasso selection over the existing layers.

Refactor select_tool and path_tool transition drag logic to determine an "intent" up front. This made it easier to incorporate the type of logic needed in this PR where the lasso select intent has priority over others, but its logic is shared with box select which has the lowest priority so it was hard to capture this in the existing if/else chain.

Part of #2647

NOTE: This is an alternate implementation compared to this simpler change: #2798

Before

graphite_fix_start_lasso_inside_before.mp4

After

graphite_fix_start_lasso_inside_after.mp4

Comment on lines -548 to -550
if handle_drag_from_anchor {
if let Some((layer, point)) = shape_editor.find_nearest_point_indices(&document.network_interface, input.mouse.position, SELECTION_THRESHOLD) {
// Check that selected point is an anchor
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't change almost any of this logic. The diff just seems large because I moved the pieces from the if/else chain into a match statement

@hemu hemu marked this pull request as ready for review June 30, 2025 00:57
@hemu
Copy link
Contributor Author

hemu commented Jun 30, 2025

if this change is too involved and not preferred there is a simpler change here: #2798

@otdavies
Copy link
Member

otdavies commented Jul 1, 2025

I tested this and didn't find any obvious regressions @Keavon 👍

@Keavon
Copy link
Member

Keavon commented Jul 5, 2025

@hemu could you please resolve the merge conflict? I tried but it looks like it affects the structure of an if-else statement that changed. Thanks.

Also, please mark this as ready for review and comment when you've completed this. I'm marking it as a draft for now while waiting the resolution.

@Keavon Keavon marked this pull request as draft July 5, 2025 22:40
@hemu
Copy link
Contributor Author

hemu commented Jul 6, 2025

looking at the other merged commits in the past week that intersect with the same files in this PR, i think too much has changed underneath and the safer thing to do at this point is redo this entirely. will close this and take another crack at in a new PR so it can get retested and re-reviewed with same level of scrutiny as a new change

@hemu hemu closed this Jul 6, 2025
@Keavon
Copy link
Member

Keavon commented Jul 6, 2025

When you have your redo ready, please push it to this branch and reopen the same PR rather than filing a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants