highlight problem in 1px border

This commit is contained in:
Alessandro Mauri 2025-07-07 14:46:06 +02:00
parent d0a8e8a1ff
commit f409a67130
3 changed files with 6 additions and 7 deletions

2
TODO
View File

@ -47,6 +47,8 @@ to maintain focus until mouse release (fix scroll bars)
## Layout
[x] Flexbox
[ ] For some reason padding is not correct, look at the sliders, they have 2px per side when the
theme specifies 4px per side
[ ] Center elements to the row/column
[ ] Text wrapping / reflow
[ ] Consider a multi-pass recursive approach to layout (like https://github.com/nicbarker/clay)

View File

@ -115,12 +115,12 @@ fn void? Ctx.push_rect(&ctx, Rect rect, int z_index, Style* style)
.rect.rect = {
.x = rect.x + border + padding.x,
.y = rect.y + border + padding.y,
.w = rect.w - (border*2) - (padding.x+padding.w),
.h = rect.h - (border*2) - (padding.y+padding.h),
.w = rect.w - (border*2) - (padding.x+padding.w),
},
.rect.color = bg,
.rect.radius = radius,
.rect.thickness = max(rect.w, rect.h),
.rect.thickness = max(rect.w, rect.h)/2+1,
};
if (cull_rect(cmd.rect.rect, ctx.div_scissor)) return;
ctx.push_cmd(&cmd, z_index)!;

View File

@ -8,7 +8,6 @@ default {
button {
margin: 2 2 2 2;
padding: 2 2 2 2;
border: 2;
radius: 10;
@ -21,7 +20,6 @@ button {
button-active {
margin: 2 2 2 2;
padding: 1 1 1 1;
border: 2;
radius: 10;
@ -34,7 +32,6 @@ button-active {
checkbox {
margin: 2 2 2 2;
padding: 1 1 1 1;
border: 2;
radius: 10;
size: 16;
@ -59,8 +56,8 @@ toggle {
slider {
margin: 2 2 2 2;
padding: 2 2 2 2;
border: 2;
padding: 4 4 4 4;
border: 1;
radius: 4;
size: 8;
bg: #3c3836ff;