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

Customize the rotation icon and the position of the rotation axis. #1788

Open
cheerylong opened this issue Jul 15, 2024 · 3 comments
Open

Customize the rotation icon and the position of the rotation axis. #1788

cheerylong opened this issue Jul 15, 2024 · 3 comments

Comments

@cheerylong
Copy link

Hello, I would like to implement this feature in the diagram using Konva. I have been searching for a long time but have not found a suitable solution. Is it possible to achieve this style in Konva? If there is a method, please provide me with some guidance. Thank you.
image

@lavrton
Copy link
Member

lavrton commented Jul 15, 2024

I think the best way is to make your own implementations of such buttons. The UI is just far from Konva.Transformer behaviour.

Just create a rectangle on top of the image, and put circles + icons for anchors. Then implement the logic of every anchor click/drag.

@cheerylong
Copy link
Author

I think the best way is to make your own implementations of such buttons. The UI is just far from Konva.Transformer behaviour.

Just create a rectangle on top of the image, and put circles + icons for anchors. Then implement the logic of every anchor click/drag.

Thank you for your reply. Are you saying that all the functions of rotation, scaling, and moving need to be manually implemented, and does Konva provide any auxiliary methods for this? Thank you.

@lavrton
Copy link
Member

lavrton commented Jul 16, 2024

does Konva provide any auxiliary methods for this?

What methods you want? Just a regular node.x(val), node.width(val), node.rotation(val) to control attributes. Do that on drag of the anchor, calculated needed values.

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

2 participants