Compare commits
No commits in common. "456921e66bac3793c64ae8dfad0dd86964a1531e" and "1fe25fb235aab6cf1022ca0c158985596b0ce24e" have entirely different histories.
456921e66b
...
1fe25fb235
|
@ -8,7 +8,7 @@ project "Dice"
|
|||
cdialect "c23"
|
||||
location "build/"
|
||||
files { "src/**.c" }
|
||||
includedirs { "include/" }
|
||||
includedirs { "vendor/" }
|
||||
links { "m", "stdc++", "SDL3", "SDL3_ttf", "SDL3_image" }
|
||||
buildoptions { "-Wall" }
|
||||
targetdir "bin/"
|
||||
|
|
|
@ -52,6 +52,8 @@ static void SDL_Clay_RenderFillRoundedRect(Clay_SDL3RendererData *rendererData,
|
|||
int totalVertices = 0;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
numCircleSegments[i] = SDL_clamp((int)radii[i] / 2, 1, NUM_CIRCLE_SEGMENTS);
|
||||
SDL_Log("num segments %d: %d", i, numCircleSegments[i]);
|
||||
SDL_Log("radius %d: %f", i, radii[i]);
|
||||
totalVertices += numCircleSegments[i];
|
||||
}
|
||||
|
||||
|
@ -150,7 +152,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 || config->cornerRadius.topRight > 0 || config->cornerRadius.bottomLeft > 0 || config->cornerRadius.bottomRight > 0) {
|
||||
if (config->cornerRadius.topLeft > 0) {
|
||||
SDL_Clay_RenderFillRoundedRect(rendererData, rect, config->cornerRadius, config->backgroundColor);
|
||||
} else {
|
||||
SDL_RenderFillRect(rendererData->renderer, &rect);
|
||||
|
|
25
src/style.h
25
src/style.h
|
@ -3,27 +3,24 @@
|
|||
|
||||
#include <clay/clay.h>
|
||||
|
||||
constexpr float cornerRadius = 20.f;
|
||||
constexpr Clay_CornerRadius cornerRadiusAll = {
|
||||
cornerRadius, cornerRadius,
|
||||
cornerRadius, cornerRadius
|
||||
};
|
||||
constexpr float containerGap = 10.f;
|
||||
constexpr float windowPadding = 10.f;
|
||||
constexpr float cornerRadius = 3.f;
|
||||
constexpr Clay_CornerRadius cornerRadiusAll = CLAY_CORNER_RADIUS(cornerRadius);
|
||||
constexpr float containerGap = 3.f;
|
||||
constexpr float windowPadding = 0.f;
|
||||
|
||||
constexpr Clay_Color windowBackground = {
|
||||
255*0.35, 255*0.35, 255*0.35, 255
|
||||
210, 210, 210, 255
|
||||
};
|
||||
constexpr Clay_Color containerColors[] = {
|
||||
{ 255*0.25, 255*0.25, 255*0.25, 255 },
|
||||
{ 255*0.2, 255*0.2, 255*0.2, 255 },
|
||||
{ 255*0.1, 255*0.1, 255*0.1, 255 },
|
||||
{ 200, 200, 200, 255 },
|
||||
{ 170, 170, 170, 255 },
|
||||
{ 140, 140, 140, 255 },
|
||||
};
|
||||
|
||||
constexpr Clay_Color textColors[] = {
|
||||
{ 250, 250, 250, 255 },
|
||||
{ 250, 250, 250, 255 },
|
||||
{ 250, 250, 250, 255 },
|
||||
{ 0, 0, 0, 255 },
|
||||
{ 15, 15, 15, 255 },
|
||||
{ 30, 30, 30, 255 },
|
||||
};
|
||||
|
||||
constexpr Clay_Sizing layoutExpand = {
|
||||
|
|
Loading…
Reference in a new issue