-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
fix(): stop transforming on discardActiveObject
#7954
Conversation
Code Coverage Summary
|
discardObject
discardObject
discardObject
discardActiveObject
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
src/canvas.class.js
Outdated
@@ -1243,6 +1243,11 @@ | |||
if (obj.onDeselect({ e: e, object: object })) { | |||
return false; | |||
} | |||
if (this._currentTransform && this._currentTransform.target === obj) { | |||
this._finalizeCurrentTransform(e); | |||
this._currentTransform = null; |
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.
should we call this._resetTransformEventData();
?
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.
@asturur this is not outdated
Thoughts?
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.
It's actually Canvas._target
, I think it should be reset but I'm not sure
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.
I have encountered the case that demands to nullify _target
When an object is being moved by the user and discarded meanwhile.
Currently the object will continue moving and will be inactive only on mouseup.
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.
Note for future self
setting canvas._target
on mousedown:before
hijacks the event and fires it on the hijacker
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 issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I m ok with this PR but i would like there was a canvas method that says |
Code Coverage Summary
|
i grouped the 2 calls in a method. i m ok merginging this. for example on object removed calls _discardActiveObject, and it could call _discardActiveObject and endCurrentTransform, instead of relying on the inner part, focused on discardind, now also fires an object modified event ( eventually ). Is not a big deal, can probably be changed later. |
Sounds a good point to me. I am not sure but I think I walked into a bug with this PR somewhere... |
is ok to merge this part as it is, is reasonably correct and help us moving forward |
is small, is focused, has a test, has docs, can be merged imho. |
Motivation
closes #7953