QuantumBadger / Speedy2D

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.
Apache License 2.0
386 stars 42 forks source link

RoundedRectangle #79

Open dennisorlando opened 1 year ago

dennisorlando commented 1 year ago

Would it be ok if I wrote a RoundedRectangle struct parallel to the normal Rectangle? I would draw it by drawing 2 rectangles in a "cross" and then 4 circles in the corner

Revertron commented 1 year ago

It would be better to have a function to draw rounded rectangle without filling with color.

QuantumBadger commented 1 year ago

I'm happy for this to be added :) The most efficient way to draw it is to:

It would be better to have a function to draw rounded rectangle without filling with color.

Yeah, this would also be good to add at some point. I think it would need changes to the shader though (so that circles have an "inner" radius in addition to the "outer" radius).

dennisorlando commented 1 year ago

Ok, working on it

dennisorlando commented 1 year ago

81, might have messed up some trait bounds, especially when using the magnitude