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

Consider adding shape events for shape.transformerAdd and shape.transformerRemove #1889

Open
VanquishedWombat opened this issue Feb 18, 2025 · 3 comments

Comments

@VanquishedWombat
Copy link
Contributor

I put this forward for discussion as an enhancement.

There are credible cases where it would be useful to know that a shape is being added to a transformer.

However, the process for this is just pushing the shape into transformer.nodes([array). There is no way to know that the shape has been added or removed from the transformer nodes list.

The proposal is to enhance the transformer with methods something like transformer.add(node) and transformer.remove(node). Within the code of the add method code would run to fire an event informing the shape that it is being added. Similarly in the remove method for the opposite.

Quite apart from anything else, the simple use of the nodes array manipulation does not allow for intervention, and it is quite primitive / unsophisticated.

What do we think?

@lavrton
Copy link
Member

lavrton commented Feb 18, 2025

What if we just add nodesChange event?

@VanquishedWombat
Copy link
Contributor Author

How would it work? Is it on the transformer or the shape? Sounds from its name like it might be on the transformer?

@lavrton
Copy link
Member

lavrton commented Feb 19, 2025

Yes, on the transformer.

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