fix: all corners are now considered when choosing between rounded and unrounded rectangle render functions

This commit is contained in:
Sara 2025-09-16 19:45:24 +02:00
parent ed28b55f8a
commit e9de2dab75

View file

@ -150,7 +150,7 @@ void SDL_Clay_RenderClayCommands(Clay_SDL3RendererData *rendererData, Clay_Rende
Clay_RectangleRenderData *config = &rcmd->renderData.rectangle;
SDL_SetRenderDrawBlendMode(rendererData->renderer, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(rendererData->renderer, config->backgroundColor.r, config->backgroundColor.g, config->backgroundColor.b, config->backgroundColor.a);
if (config->cornerRadius.topLeft > 0) {
if (config->cornerRadius.topLeft > 0 || config->cornerRadius.topRight > 0 || config->cornerRadius.bottomLeft > 0 || config->cornerRadius.bottomRight > 0) {
SDL_Clay_RenderFillRoundedRect(rendererData, rect, config->cornerRadius, config->backgroundColor);
} else {
SDL_RenderFillRect(rendererData->renderer, &rect);