From d97d662984ca5f001317e6ac5fd15f6eecc5944f Mon Sep 17 00:00:00 2001 From: Dudemanguy911 Date: Tue, 8 May 2018 12:41:26 -0500 Subject: [PATCH] fix case where drawing border gets off by 1 pixel --- sway/desktop/output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sway/desktop/output.c b/sway/desktop/output.c index f1f239a84..92bccd340 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -439,7 +439,7 @@ static void render_container_top_tabbed_border_normal(struct sway_output *output wlr_backend_get_renderer(output->wlr_output->backend); struct wlr_box box; float color[4]; - size_t num_tabs = con->parent->children->length; + float num_tabs = con->parent->children->length; float tab_width = con->width / num_tabs; // Single pixel bar above title @@ -447,7 +447,7 @@ static void render_container_top_tabbed_border_normal(struct sway_output *output color[3] *= con->alpha; box.x = con->x + depth * tab_width; box.y = con->y; - box.width = con->width / num_tabs; + box.width = con->width / num_tabs + 1; box.height = 1; scale_box(&box, output->wlr_output->scale); wlr_render_rect(renderer, &box, color, @@ -456,7 +456,7 @@ static void render_container_top_tabbed_border_normal(struct sway_output *output // Single pixel bar below title box.x = con->x + depth*tab_width; box.y = con->sway_view->y - 1; - box.width = con->width / num_tabs; + box.width = con->width / num_tabs + 1; box.height = 1; scale_box(&box, output->wlr_output->scale); wlr_render_rect(renderer, &box, color, @@ -485,7 +485,7 @@ static void render_container_top_tabbed_border_normal(struct sway_output *output color[3] *= con->alpha; box.x = con->x + con->sway_view->border_thickness + depth * tab_width; box.y = con->y + 1; - box.width = con->width / num_tabs - con->sway_view->border_thickness * 2; + box.width = con->width / num_tabs - con->sway_view->border_thickness * 2 + 1; box.height = con->sway_view->y - con->y - 2; scale_box(&box, output->wlr_output->scale); wlr_render_rect(renderer, &box, color,