Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoundedRectangle #79

Open
dennisorlando opened this issue Apr 1, 2023 · 4 comments
Open

RoundedRectangle #79

dennisorlando opened this issue Apr 1, 2023 · 4 comments

Comments

@dennisorlando
Copy link
Contributor

dennisorlando commented Apr 1, 2023

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
Copy link
Contributor

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

@QuantumBadger
Copy link
Owner

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

  • Use three rectangles instead of two, to avoid unnecessarily drawing the overlapping area
  • Similarly, with the four circles, it's only necessary to draw a quarter of each one -- this can be done using draw_circle_section_triangular_three_color() twice for each corner

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
Copy link
Contributor Author

Ok, working on it

@dennisorlando
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants