fix top border size and placement (#356)

This commit is contained in:
amy 2024-10-09 10:25:07 -05:00 committed by Alex Janka
parent 74f251134a
commit 08ace74498

View file

@ -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);