From: Michael Stapelberg Date: Wed, 5 Sep 2012 21:54:56 +0000 (+0200) Subject: rendering: ceil() instead of truncating for tabbed deco_rect width (Thanks szalik) X-Git-Tag: 4.3~36 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1e3e6997f4f6046f6c2b2850837b01bf89cb0229;p=i3%2Fi3 rendering: ceil() instead of truncating for tabbed deco_rect width (Thanks szalik) 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 --- 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;