terra-draw
terra-draw copied to clipboard
[Feature Request] Click+drag for rectangle mode as alternative instead of click + click
Hi there, thanks for a great drawing solution! I have rolled it out in my product and experienced some complaints from the users though:
Is your feature request related to a problem? Please describe. My product only needs to draw BBOXes, so I am using Rectangle mode. It seems that users expect to click+drag to draw like in every graphic editor that draws rectangles instead of clicking for the starting and ending position.
Describe your proposed idea for the solution to this problem It would be fantastic to either expose base drawing mode as an export so it's easier to create custom drawing modes OR add an alternative "mode" to the rectangle drawing mode so it's using click+drag. Either or both would be great.
Describe alternatives you've considered I have tried implementing a custom render mode but in the short time available to me it wasn't feasible due to the nature of the current implementation: too many interconnected imports that are not exported from the main package. If it was more modular it would be easier to deal with.
Hi @max-degterev thanks for the kind words - appreciate it. I totally understand the use case you're describing here - I think the best approach would be a custom mode. There's an example of how to build a custom mode here, which I just updated to version 1.2.0:
https://github.com/JamesLMilner/terra-draw-route-snap-mode
I appreciate there might be some improvements that could be made to the way custom modes are implemented and value any feedback you have on making it easier. It would be useful to understand what is missing to help make it easier.
I am going to close this issue in order to keep the open issue numbers manageable. Hopefully the example terra-draw-route-snap-mode provides an example of how to build a custom mode. Please feel free to open a new issue if anyone hits any problems.