mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 04:38:01 +00:00
[Renderers/SDL2] Removed superflous scopes.
This commit is contained in:
parent
441434eb4e
commit
c457d6af61
@ -117,43 +117,33 @@ static void Clay_SDL2_Render(SDL_Renderer *renderer, Clay_RenderCommandArray ren
|
|||||||
|
|
||||||
if (config->left.width > 0) {
|
if (config->left.width > 0) {
|
||||||
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->left.color));
|
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->left.color));
|
||||||
{
|
|
||||||
SDL_FRect rect = { boundingBox.x, boundingBox.y + config->cornerRadius.topLeft, config->left.width, boundingBox.height - config->cornerRadius.topLeft - config->cornerRadius.bottomLeft };
|
SDL_FRect rect = { boundingBox.x, boundingBox.y + config->cornerRadius.topLeft, config->left.width, boundingBox.height - config->cornerRadius.topLeft - config->cornerRadius.bottomLeft };
|
||||||
SDL_RenderFillRectF(renderer, &rect);
|
SDL_RenderFillRectF(renderer, &rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->right.width > 0) {
|
||||||
|
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
||||||
|
SDL_FRect rect = { boundingBox.x + boundingBox.width - config->right.width, boundingBox.y + config->cornerRadius.topRight, config->right.width, boundingBox.height - config->cornerRadius.topRight - config->cornerRadius.bottomRight };
|
||||||
|
SDL_RenderFillRectF(renderer, &rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->right.width > 0) {
|
if (config->right.width > 0) {
|
||||||
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
||||||
{
|
|
||||||
SDL_FRect rect = { boundingBox.x + boundingBox.width - config->right.width, boundingBox.y + config->cornerRadius.topRight, config->right.width, boundingBox.height - config->cornerRadius.topRight - config->cornerRadius.bottomRight };
|
SDL_FRect rect = { boundingBox.x + boundingBox.width - config->right.width, boundingBox.y + config->cornerRadius.topRight, config->right.width, boundingBox.height - config->cornerRadius.topRight - config->cornerRadius.bottomRight };
|
||||||
SDL_RenderFillRectF(renderer, &rect);
|
SDL_RenderFillRectF(renderer, &rect);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (config->right.width > 0) {
|
|
||||||
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
|
||||||
{
|
|
||||||
SDL_FRect rect = { boundingBox.x + boundingBox.width - config->right.width, boundingBox.y + config->cornerRadius.topRight, config->right.width, boundingBox.height - config->cornerRadius.topRight - config->cornerRadius.bottomRight };
|
|
||||||
SDL_RenderFillRectF(renderer, &rect);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config->top.width > 0) {
|
if (config->top.width > 0) {
|
||||||
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->right.color));
|
||||||
{
|
|
||||||
SDL_FRect rect = { boundingBox.x + config->cornerRadius.topLeft, boundingBox.y, boundingBox.width - config->cornerRadius.topLeft - config->cornerRadius.topRight, config->top.width };
|
SDL_FRect rect = { boundingBox.x + config->cornerRadius.topLeft, boundingBox.y, boundingBox.width - config->cornerRadius.topLeft - config->cornerRadius.topRight, config->top.width };
|
||||||
SDL_RenderFillRectF(renderer, &rect);
|
SDL_RenderFillRectF(renderer, &rect);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (config->bottom.width > 0) {
|
if (config->bottom.width > 0) {
|
||||||
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->bottom.color));
|
SDL_SetRenderDrawColor(renderer, CLAY_COLOR_TO_SDL_COLOR_ARGS(config->bottom.color));
|
||||||
{
|
|
||||||
SDL_FRect rect = { boundingBox.x + config->cornerRadius.bottomLeft, boundingBox.y + boundingBox.height - config->bottom.width, boundingBox.width - config->cornerRadius.bottomLeft - config->cornerRadius.bottomRight, config->bottom.width };
|
SDL_FRect rect = { boundingBox.x + config->cornerRadius.bottomLeft, boundingBox.y + boundingBox.height - config->bottom.width, boundingBox.width - config->cornerRadius.bottomLeft - config->cornerRadius.bottomRight, config->bottom.width };
|
||||||
SDL_RenderFillRectF(renderer, &rect);
|
SDL_RenderFillRectF(renderer, &rect);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user