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

SDL3: Add rounded corners rectangle functionality #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArnauNau
Copy link

Added one of the missing features for the SDL3 renderer.

Copy link
Author

@ArnauNau ArnauNau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternate radius value discussion. The RayLib module compares topRight corner radius with boundingBox and chooses one of the two depending on the comparison result. I'm not sure why it does that but I've added the same logic but left it commented out so if someone knows why it's there and it's needed it can be quickly added to the SDL3 module by uncommenting that and commenting the current call.

SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
SDL_RenderFillRect(renderer, &rect);
if (config->cornerRadius.topLeft > 0) {
//const float radius = (config->cornerRadius.topLeft * 2) / (float)((bounding_box.width > bounding_box.height) ? bounding_box.height : bounding_box.width);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in the RayLib renderer module, left it here commented in case anyone (Nic maybe) knows why and if it needs to be done here too.

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

Successfully merging this pull request may close these issues.

1 participant