From 08ace744987456b9b0777919ef1277b0d0a4974c Mon Sep 17 00:00:00 2001 From: amy Date: Wed, 9 Oct 2024 10:25:07 -0500 Subject: [PATCH] fix top border size and placement (#356) --- sway/desktop/render.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 13670fdc..ae1aacae 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -1271,9 +1271,11 @@ static void render_top_border(struct fx_render_context *ctx, struct sway_contain // Child border - top edge memcpy(&color, colors->child_border, sizeof(float) * 4); premultiply_alpha(color, con->alpha); - box.x = floor(state->x) + corner_radius; + box.x = floor(state->x) + + (corner_radius != 0) * (corner_radius + state->border_thickness); box.y = floor(state->y); - box.width = state->width - (2 * corner_radius); + box.width = state->width - + ((corner_radius != 0) * 2 * (corner_radius + state->border_thickness)); box.height = state->border_thickness; adjust_box_to_workspace_offset(&box, on_focused_workspace, ctx->output); scale_box(&box, output_scale);