-
-
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(): use sendObjectToPlane
in mergeClipPaths
#8247
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.
Refactored src/util/misc/planeChange.ts
a bit, to make more readable
src/util/misc/planeChange.ts
Outdated
// we are actually looking for the transformation from the destination plane to the source plane (which is a linear mapping) | ||
// the object will exist on the destination plane and we want it to seem unchanged by it so we reverse the destination matrix (to) and then apply the source matrix (from) | ||
const t = multiplyTransformMatrices(invertTransform(to), from); | ||
export const sendObjectToPlane = (object: TObject, from: TMat2D = iMatrix, to: TMat2D = iMatrix): TMat2D => { |
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 want to add a signature that accepts objects once we migrate Object
so I can do instanceof
if it won't overkill imports or make it strange
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.
Naming: calcChangePlaneMatrix
or calcPlaneChangeMatrix
?
fabric.js/src/mixins/canvas_events.mixin.ts Line 1097 in f9761dd
|
Yes you win, and now i see where i m wrong. the multiplication of calcTransformMatrix is from the outside to the inside, while i was sure it was from the inside to the outside!! |
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.
READY
If you are satisfied with naming merge it
maybe this wasn't a fix(), but only an optimization or a refactor |
it fixed the |
Co-authored-by: Andrea Bogazzi <andreabogazzi79@gmail.com>
I win 😋
I don't think so, i think you are inverting a multiplcation order.
If there is no group, you send null ( let's say is conditionally an IMatrix ).
In the case the group exist you are going to multiply forst for the group matrix and then for the object one,
in the case as it is today, you are multiplying for the ( OBJECT x CONTAINER ).
I ll write a failing unit test, and then you'll owe me a cocacola first time we ever meet.
Originally posted by @asturur in #8230 (comment)