aboutsummaryrefslogtreecommitdiff
path: root/src/layout.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-07-12 23:32:17 +0200
committerFederico Angelilli <code@fedang.net>2024-07-12 23:32:17 +0200
commita60a1a755598240f5a7705070179bfa707ad4c56 (patch)
treeb2f3a909ad03f18dff4508080989944a9047da81 /src/layout.c
parentc6dc8e969c84b1980dcebd5dc3a59d112fa61c53 (diff)
Minor fixes and refactor
Diffstat (limited to 'src/layout.c')
-rw-r--r--src/layout.c14
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);