[Renderers/SDL3] Add rounded corners rectangle functionality (#219)

This commit is contained in:
arnauNau 2025-01-22 21:30:24 +01:00 committed by GitHub
parent 9d659e8abd
commit aba846a446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 127 additions and 10 deletions

View file

@ -33,9 +33,13 @@ static inline Clay_Dimensions SDL_MeasureText(Clay_StringSlice text, Clay_TextEl
return (Clay_Dimensions) { (float) width, (float) height };
}
static void Label(Clay_String text)
static void Label(const Clay_String text)
{
CLAY(CLAY_LAYOUT({ .padding = {16, 8} }), CLAY_RECTANGLE({ .color = Clay_Hovered() ? COLOR_BLUE : COLOR_ORANGE })) {
CLAY(CLAY_LAYOUT({ .padding = {8, 8} }),
CLAY_RECTANGLE({
.color = Clay_Hovered() ? COLOR_BLUE : COLOR_ORANGE,
.cornerRadius = (Clay_CornerRadius){ 8, 8, 8, 8 },
})) {
CLAY_TEXT(text, CLAY_TEXT_CONFIG({
.textColor = { 255, 255, 255, 255 },
.fontId = FONT_ID,