From 1e3e6997f4f6046f6c2b2850837b01bf89cb0229 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 5 Sep 2012 23:54:56 +0200 Subject: [PATCH] rendering: ceil() instead of truncating for tabbed deco_rect width (Thanks szalik) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In tabbed mode, the available width (say 1280) is divided by the amount of child containers (say 3). Before this commit, we just truncated the result and would end up with 426 + 426 + 426 = 1278 pixels that we render to. Now we render a bit too much, but that’ll at least not give us graphics corruption on any side :). fixes #791 --- src/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render.c b/src/render.c index d7b8cd28..01628c35 100644 --- a/src/render.c +++ b/src/render.c @@ -345,7 +345,7 @@ void render_con(Con *con, bool render_fullscreen) { child->rect.width = rect.width; child->rect.height = rect.height; - child->deco_rect.width = child->rect.width / children; + child->deco_rect.width = ceil((float)child->rect.width / children); child->deco_rect.x = x - con->rect.x + i * child->deco_rect.width; child->deco_rect.y = y - con->rect.y; -- 2.39.5