nannou
nannou copied to clipboard
Rounded corners on rect
I'm not seeing any way to add rounded corners for rect shapes. Assuming this is a feature that isn't yet implemented, I'd be grateful if anyone can point me to where I should start looking in order to work on implementing this. I'm new to both Nannou and Rust but I'd be interested to take a stab at contributing some code if possible.
Otherwise, if it is implemented, please let me know how to do it.
You could do this easily by drawing a polyline: https://guide.nannou.cc/tutorials/basics/drawing-2d-shapes.html
maybe you could write a nice addition to the rect.rs or add polyline.rs this this kinda functionality? https://github.com/nannou-org/nannou/blob/master/nannou/src/draw/primitive/rect.rs
I have a working implementation that follows along with the approach in ellipse.rs , using an svg_builder to build the path. Will submit a PR shortly. I don't currently grok the testing approach for this part of the library, but the rounded rectangle is implemented in the draw example.