-
Notifications
You must be signed in to change notification settings - Fork 22
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
Magic contour selection #1704
base: main
Are you sure you want to change the base?
Magic contour selection #1704
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not yet a solid code review, but I found one small issue.
However, there is a bigger thing missing: whenever the "magic behavior" is active (regardless of how we decide to activate it), the user should see what will be selected once they click. In other words, this is missing "hover" behavior. It should set sceneController.hoverSelection
appropriately while hovering.
} | ||
const selection = this._selectionBeforeSingleClick || sceneController.selection; | ||
this._selectionBeforeSingleClick = undefined; | ||
const modeFunc = selectModeFunction(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While refactoring this bit of code, you forgot to pass event
down. This is now falling back to window.event
, which is probably just accidentally working. (window.event
is a deprecated property.)
A pull request for magic contour selection with the pointer tool.
By holding the cmd (metaKey) modifier key:
Note:
In
path-hit-tester.js
->PathHitTester
->findNearest
, I commented out line 65:results = results.filter((hit) => hit.t != 0 && hit.t != 1);
This line restricts findNearest to only work when, in the case of a rectangular shape, the cursor's x value is between the rectangle's xmin and xmax, or the y value is between its ymin and ymax.
This function is used exclusively with the power ruler tool and now the pointer tool. Commenting out this line seems to have no effect on the power ruler tool.