From b1cc4d5166f3c9b4908c7424d3b577ca25a45940 Mon Sep 17 00:00:00 2001 From: Marius Muja Date: Mon, 31 Dec 2012 03:04:53 -0800 Subject: [PATCH] Fix decoration rect size for windows without border --- src/render.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/render.c b/src/render.c index 85347c4c..9ac4b78e 100644 --- a/src/render.c +++ b/src/render.c @@ -309,16 +309,23 @@ void render_con(Con *con, bool render_fullscreen) { } /* first we have the decoration, if this is a leaf node */ - if (con_is_leaf(child) && child->border_style == BS_NORMAL) { - /* TODO: make a function for relative coords? */ - child->deco_rect.x = child->rect.x - con->rect.x; - child->deco_rect.y = child->rect.y - con->rect.y; - - child->rect.y += deco_height; - child->rect.height -= deco_height; - - child->deco_rect.width = child->rect.width; - child->deco_rect.height = deco_height; + if (con_is_leaf(child)) { + if (child->border_style == BS_NORMAL) { + /* TODO: make a function for relative coords? */ + child->deco_rect.x = child->rect.x - con->rect.x; + child->deco_rect.y = child->rect.y - con->rect.y; + + child->rect.y += deco_height; + child->rect.height -= deco_height; + + child->deco_rect.width = child->rect.width; + child->deco_rect.height = deco_height; + } else { + child->deco_rect.x = 0; + child->deco_rect.y = 0; + child->deco_rect.width = 0; + child->deco_rect.height = 0; + } } } -- 2.39.5