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

Feature Request: Transformer support custom create anchor #1737

Open
leecz opened this issue Mar 22, 2024 · 3 comments
Open

Feature Request: Transformer support custom create anchor #1737

leecz opened this issue Mar 22, 2024 · 3 comments

Comments

@leecz
Copy link

leecz commented Mar 22, 2024

to solve the problem: arrow transform like excalidraw's arrow

I wish to have a function createCustomAnchor in Transformer class like _createAnchor, and this function will return the created anchor,so i can bind event handlers to them 。

Thank you for this great library!

@bogdan-nourescu
Copy link

@leecz
You can use anchorStyleFunc.
That function receives 1 Shape as argument

@bogdan-nourescu
Copy link

Another way to do that, you can use .findOne to get each of the corners by name and add the event listeners on them. Transformer is just a Group, so you can use multiple ways to get the elements inside

@leecz
Copy link
Author

leecz commented Apr 28, 2024

@bogdan-nourescu
Thanks!
I tried。
It can barely achieve the requirements, but the effect is not good and it is a bit complicated because it needs to switch between two types of transformers。

It would be better if Tansformer could open an interface for creating custom anchors, and these anchors could automatically listen to built-in transform events (such as _handleMouseMove)。

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