Open vinhhungle opened 2 years ago
everything in draw2d is managed by EditPolicies
.
and of course the edit behaviour of polygons. You can just install another EditPolicy to get the expected behaviour.
There is no policy related to click-to-add vertex behavior. However, I've found a work around. Thanks.
did you check my sample? There is.
Yes, I've seen it. However, the requirement for my case is different. I still need the original vertices to be editable but I don't need the click-to-add vertex behavior. So my current workaround is to add an attribute to the original vertices and remove any vertices without that attribute.
the best is to implement your own SelectionHandler instead of removing the points after user-edit. It is possible to manage almost everything via Policies.
I Update the example with your requirements
https://codepen.io/freegroup/pen/PoEaRvj
I think the shape in the middle fits best your needs.
Got it. Thank you for your help!
Currently, when clicking on a polygon line, it will add a vertex. I'm trying to find a way to disable this behavior. Is there anyway to do this? Thank you for your help!