-
-
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(Group, Controls): Fix interactive group actions when negative scaling is involved #9811
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Build Stats
|
transformOptions.scaleX = Math.abs(transformOptions.scaleX); | ||
transformOptions.scaleY = Math.abs(transformOptions.scaleY); | ||
} | ||
const dim = this._calculateCurrentDimensions(transformOptions), |
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.
Having _getTransformedDimensions
returning always absolute numbers could be the more correct solution but i don't want to shake that now for an edge case fix.
There could be something that is relying on the case of negative dimensions.
having this.scaleX or this.scaleY negative is not supported in general and this is the only place where we use the options for calcDimensions with unchecked values
…c.js into investigate-flip-controls
Check the snapshot at commit 1470524 to see it rendered with master code |
this is going to be merged monday if there are no comments. |
unit test pass on node 20 but the pod crash afterwards for some reason. |
Description
Today when detecting where oCoords are in a group we have to use a series of transformations.
One of those requires calculating the transformedDimensions/currentDimension of an object arbitrarly transformed.
Sometimes when a flipping enters those transforms the dimensions are reported as negative.
This flips the control position compared to where we expect them and also interact negatively with padding:
This PR try to work around this issue by ensuring the scale values are always positive.
closes #9801