From a60a1a755598240f5a7705070179bfa707ad4c56 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Fri, 12 Jul 2024 23:32:17 +0200 Subject: Minor fixes and refactor --- src/layout.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/layout.c') diff --git a/src/layout.c b/src/layout.c index 0b0f826..6b6590e 100644 --- a/src/layout.c +++ b/src/layout.c @@ -8,10 +8,10 @@ void layout_init(layout_t *layout, block_t *block, layout_info_t info) { - assert(!block->hidden); - memset(layout, 0, sizeof(layout_t)); + assert(!block->hidden); + layout->block = block; layout->x = info.x_offset; layout->y = 0; @@ -35,6 +35,16 @@ void layout_init(layout_t *layout, block_t *block, layout_info_t info) if (layout->n_children > 0) { layout_t *last = &layout->children[layout->n_children - 1]; layout->width = last->x + last->width - x_offset; + + // NOTE: Temporary solution to make blocks not overlapping correctly + // less noticeable + if (layout->children[0].x_padding == 0) { + layout->x += 1; + layout->width -= 1; + } + + if (last->x_padding == 0) + layout->width -= 1; } } else if (block->type == BLOCK_TEXT) { layout->pl = pango_layout_new(info.context); -- cgit v1.2.3