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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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 👍

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.

2 participants