diff options
Diffstat (limited to 'src/layout.c')
| -rw-r--r-- | src/layout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c index db6e435..126e2f5 100644 --- a/src/layout.c +++ b/src/layout.c @@ -20,6 +20,7 @@ layout_t *layout_create(block_t *block, layout_info_t info) if (block->type == BLOCK_GROUP) { layout->children = calloc(block->group.n_children, sizeof(layout_t)); + int x = info.x_offset; for (int i = 0; i < block->group.n_children; i++) { if (block->group.children[i].hidden) @@ -29,6 +30,9 @@ layout_t *layout_create(block_t *block, layout_info_t info) info.x_offset += child->width + block->group.spacing; layout->children[layout->n_children++] = child; } + + layout_t *last = layout->children[layout->n_children - 1]; + layout->width = last->x + last->width - x; } else if (block->type == BLOCK_TEXT) { layout->pl = pango_layout_new(info.context); |
