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

Allow deleting the whole feature from direct_select #975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trygveaa
Copy link

When no vertices are selected, trash deletes the whole feature.

@trygveaa trygveaa force-pushed the direct-select-trash-whole-feature branch from cf58748 to 3cd03ba Compare March 20, 2020 18:01
When no vertices are selected, trash deletes the whole feature.
@trygveaa trygveaa force-pushed the direct-select-trash-whole-feature branch from 3cd03ba to a4c3ab8 Compare March 20, 2020 20:24
@karimnaaji karimnaaji closed this Jun 16, 2020
@karimnaaji karimnaaji reopened this Jun 16, 2020
@arindam1993 arindam1993 changed the base branch from master to main June 17, 2020 01:23
Copy link
Contributor

@adrianababakanian adrianababakanian left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR @trygveaa . The suggestion conflicts a bit with the logic outlined by the difference between the direct_select and simple_select modes -- which is not to say this can't be changed, just that we should consider the implications before moving forward.

Per the API reference for simple_select and direct_select, the former lets you "select, delete, and drag features" whereas the later lets you "select, delete, and drag vertices." This is reinforced by direct_select's fireActionableState method:

DirectSelect.fireActionable = function(state) {
this.setActionableState({
combineFeatures: false,
uncombineFeatures: false,
trash: state.selectedCoordPaths.length > 0
});
};

The trash action is intended to only have effect when state.selectedCoordPaths.length > 0, which this PR would change.

Is the motivation here to remove the need to "click away" from a feature when it is in direct_select in order to then delete the feature with simple_select? I see the benefit this could provide to the user experience (i.e. fewer clicks), but also would like to consider the fact that this would blur the distinction between direct_select (more vertex-oriented) and simple_select (more feature-oriented).

That being said, both modes do allow features to be dragged.

@neodescis
Copy link
Contributor

neodescis commented Jan 16, 2023

I think this change would be great. It's not always immediately obvious to the user whether they're in direct or simple select mode, especially after just creating a shape. If no vertices are selected, it's pretty strange to just do nothing when hitting trash/delete.

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.

4 participants