mostly correct padding rendering
This commit is contained in:
parent
c1c1247af4
commit
b35bb427a7
4 changed files with 16 additions and 6 deletions
|
|
@ -14,6 +14,7 @@ enum CmdType {
|
|||
// command to draw a rect
|
||||
struct CmdRect {
|
||||
Rect rect;
|
||||
ushort thickness;
|
||||
ushort radius;
|
||||
Color color;
|
||||
}
|
||||
|
|
@ -104,6 +105,7 @@ fn void? Ctx.push_rect(&ctx, Rect rect, int z_index, Style* style)
|
|||
.rect.rect = rect,
|
||||
.rect.color = border_color,
|
||||
.rect.radius = radius,
|
||||
.rect.thickness = border.x,
|
||||
};
|
||||
ctx.push_cmd(&cmd, z_index)!;
|
||||
}
|
||||
|
|
@ -118,6 +120,7 @@ fn void? Ctx.push_rect(&ctx, Rect rect, int z_index, Style* style)
|
|||
},
|
||||
.rect.color = bg,
|
||||
.rect.radius = radius,
|
||||
.rect.thickness = max(rect.w, rect.h),
|
||||
};
|
||||
if (cull_rect(cmd.rect.rect, ctx.div_scissor)) return;
|
||||
ctx.push_cmd(&cmd, z_index)!;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue