From 226c6b5bf79912b657c7cb4c5a679891030fa453 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 11 Jul 2024 13:08:26 +0200 Subject: Start working on block config --- src/layout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/layout.c') diff --git a/src/layout.c b/src/layout.c index c5969fb..ce6b281 100644 --- a/src/layout.c +++ b/src/layout.c @@ -32,8 +32,10 @@ void layout_init(layout_t *layout, block_t *block, layout_info_t info) layout->n_children++; } - layout_t *last = &layout->children[layout->n_children - 1]; - layout->width = last->x + last->width - x_offset; + if (layout->n_children > 0) { + layout_t *last = &layout->children[layout->n_children - 1]; + layout->width = last->x + last->width - x_offset; + } } else if (block->type == BLOCK_TEXT) { layout->pl = pango_layout_new(info.context); -- cgit v1.2.3