Skip to content
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

non-movingAnchor postion changed when resize a rect with falsy "flipEnabled" flag #1433

Closed
ndNovaDev opened this issue Oct 18, 2022 · 5 comments

Comments

@ndNovaDev
Copy link

if pass "true" to "flipEnabled", the non-movingAnchor postion will fixed at the original position when resize
but if pass "false" to "flipEnabled", the non-movingAnchor postion will change when resize

@ndNovaDev
Copy link
Author

@MadeByMike
Copy link
Contributor

@lavrton sorry for the ping but this issue also effects the Polotno repo including some of the examples you have:

loooooook

What's happening is when the anchor point switches, if not flipping, the position of the node changes:

https://github.com/konvajs/konva/blob/963119f24e06320169dc25a4ad5613a773d87c6b/src/shapes/Transformer.ts#L991C1-L991C13

I'm not sure if the best solution is just not changing the anchor if flipEnabled is false and locking the item to a minimum size.

Maybe there is a solution that allows flipping the bounding box without flipping the image and keeping the origin stable. But personally, I'd be happy with limiting the size of the bounding box and preventing switching anchors.

What do you think?

@MadeByMike
Copy link
Contributor

I have a fix. It turns out it was easier to translate the bounding box so that the behaviour feels exactly the same, but the image doesn't flip: #1659

Let me know if this is the right approach.

@MadeByMike
Copy link
Contributor

Resolved now by #1659 ?

@lavrton
Copy link
Member

lavrton commented Oct 31, 2023

I just released a new version with the fix by @MadeByMike . I think it works correctly now. @ndNovaDev can you confirm?

@lavrton lavrton closed this as completed Nov 2, 2023
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

No branches or pull requests

3 participants