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

feat: rectangle and brush type lasso selection #212

Merged
merged 8 commits into from
Jan 19, 2025

Conversation

flekschas
Copy link
Owner

@flekschas flekschas commented Jan 19, 2025

This PR adds two new lasso types for selecting points: rectangle and brush. It also adds support for removing selected points and mapping multiple action onto the same modifier key.

In addition, this PR updates the example pages by moving settings to a Tweakpane panel.

Description

What was changed in this pull request?

  • Feat: add support for two new lasso types: 'rectangle' and 'brush'. The lasso type can be changed via lassoType. Additionally, for the brush lasso, you can adjust the brush size via lassoBrushSize. The default lasso type is 'freeform'. (#186)
  • Feat: replace keyMap with actionKeyMap to allow triggering multiple actions with the same modifier key.
  • Feat: add 'remove' key action to allow removing selecting points. By default, to rgitemove selected points hold down ALT and then lasso around selected points. (#105)

Why is it necessary?

Fixes #186
Fixes #105

Examples

Illustrating the brush and rectangle lasso types. When holding down ALT (by default), you can remove points from the selection (new). And when holding down CMD (by default), you can add points to the selection (existed before).

Screen.Recording.2025-01-19.at.1.39.43.PM.mp4

Checklist

  • Provided a concise title as a semantic commit message (e.g. "fix: correctly handle undefined properties")
  • CHANGELOG.md updated
  • Tests added or updated
  • Documentation in README.md added or updated
  • Example(s) added or updated
  • Screenshot, gif, or video attached for visual changes

@flekschas flekschas merged commit 2bd9ac8 into main Jan 19, 2025
2 checks passed
@flekschas flekschas deleted the flekschas/rectangle-select branch January 19, 2025 18:53
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.

Lasso function allow to deselect via lasso?
1 participant