diff options
Diffstat (limited to 'src/layout.c')
| -rw-r--r-- | src/layout.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); |
