Add more tools to test the new architecture
Tools v2
After having dubbled a bit with implementing the CanvasToolCtx, I came to the conclusion that a tool context is like a widget.
With the current design, CanvasToolState would be an aggregate of all…
WIP: Eraser implementation
After more experimentation, I think we should give even more effort to this feature.
In the final application the user would have a palette of costumizable tools, e.g.: one black pen, one red pen, etc. So some tools would be fixed (like the eraser), while others would be dynamically created.
This means that our Widget data contains something along the line of Vec<CanvasTool>.
WIP: Eraser implementation
After thinking a bit more about the statefulness of tools, I think we should implement the two following tools as a test:
- pen that changes color while drawing
- tool to create a closed polygon by pressing consecutively on points in the canvas
WIP: Eraser implementation
Small brain dump:
- we need to put the AGPL header on every new file
- When a stroke is fully cancelled, it shall be removed from the canvas vector