Skip to content

fix: After horizontally flipping the child elements within the group, the cursor display is incorrect #10654

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zhe-he
Copy link
Contributor

@zhe-he zhe-he commented Jun 9, 2025

I noticed that when a child element is flipped horizontally, its angle is reduced by 180 degrees. Therefore, I updated the calculation to obtain the total angle of the child element - when it's horizontally flipped, I added back the 180 degrees that were subtracted.

Copy link

codesandbox bot commented Jun 9, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented Jun 9, 2025

Build Stats

file / KB (diff) bundled minified
fabric 919.693 (+1.834) 302.555 (+0.389)

@asturur
Copy link
Member

asturur commented Jun 9, 2025

That won't work all the time, we need to find the angle independently from the matrix.

@asturur
Copy link
Member

asturur commented Jun 9, 2025

Try to follow this fix:
get the center point of the object, get the point of the center point corner you are hovering.
Use createVector utility to make a vector between the 2 points, use calcVectorRotation to get the angle of this vector, use this angle to find in which quadrant are you.
This will be independent from the transform matrix and we can avoid the bug.

@zhe-he
Copy link
Contributor Author

zhe-he commented Jun 9, 2025

Got it, I'll go with your suggestion. First, I need to figure out how to determine the coordinates of the four corners.

@zhe-he
Copy link
Contributor Author

zhe-he commented Jun 10, 2025

Try to follow this fix: get the center point of the object, get the point of the center point corner you are hovering. Use createVector utility to make a vector between the 2 points, use calcVectorRotation to get the angle of this vector, use this angle to find in which quadrant are you. This will be independent from the transform matrix and we can avoid the bug.

Done, please check

@asturur
Copy link
Member

asturur commented Jun 11, 2025

I m back from a couple of full days.
I m pretty much sure we can use the current vector functions to do what you did, let me try today, i ll get back to you

@asturur
Copy link
Member

asturur commented Jun 19, 2025

I didn't forget about this, i just don't have time to sit down and check properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants