-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
TransformControls.js: Added reset() method #22972
Conversation
Added method to reset object to state when the transform dragging started. The transform action can also be stopped immediately after by using the optional parameter set to `true`.
Would it be possible to remove the optional parameter and not touch the event listener? Other controls also have |
Removed the optional parameter for stopping transform after reset.
After some tests I'am wondering if it isn't better to reset If you currently translate an object and call |
The idea for this feature was that you had the possibility to cancel the current transform, as a sort of undo. So that you could revert the transform while you are still dragging. I'm not sure if this is similar to the The jumping of the object is the desired result in this case. The previous (now removed) optional parameter would make it possible to immediately stop any further transform of that dragging action. (Mouse up and a new mouse down would start a new transform if needed.) What would be the behavior you expected? Or what would feel less strange? Do you mean like a transition animation instead of snapping back? (Option A) |
I think option B would feel best. |
Ok, I'll have a go at that. |
Continue transform from the reset state.
Updated: Note: For example:
Result |
Updated the `js` version as well.
Added missing documentation for `setScaleSnap()` and moved `reset()` to the correct alphabetical place.
Thanks for highlighting the details! I think the implemented approach feels good now. |
Thanks! |
Description
There was no (easy) way to cancel/abort a transform action. The pull request adds that functionality.
Added method to reset object to state when the transform dragging started. Further transform action can be stopped immediately after resetting the object by using the optional parameter set to
true
.Changes from outdated related prior pull request: #21661
The prior pull request involved two methods (
cancel
andstop
). Looking at what the added functionality is, naming itreset
seems more appropriate. Also, the addedstop
method was overly complex, so the optional unbinding of thepointermove
event is included in thereset
method.Resolves #21655, closes #21661