diff options
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r-- | sway/tree/arrange.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 7b88b3a2..e4f59110 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c | |||
@@ -78,9 +78,10 @@ static void apply_horiz_layout(list_t *children, struct wlr_box *parent) { | |||
78 | double child_x = parent->x; | 78 | double child_x = parent->x; |
79 | for (int i = 0; i < children->length; ++i) { | 79 | for (int i = 0; i < children->length; ++i) { |
80 | struct sway_container *child = children->items[i]; | 80 | struct sway_container *child = children->items[i]; |
81 | child->child_total_width = child_total_width; | ||
81 | child->x = child_x; | 82 | child->x = child_x; |
82 | child->y = parent->y; | 83 | child->y = parent->y; |
83 | child->width = floor(child->width_fraction * child_total_width); | 84 | child->width = round(child->width_fraction * child_total_width); |
84 | child->height = parent->height; | 85 | child->height = parent->height; |
85 | child_x += child->width + inner_gap; | 86 | child_x += child->width + inner_gap; |
86 | 87 | ||
@@ -156,10 +157,11 @@ static void apply_vert_layout(list_t *children, struct wlr_box *parent) { | |||
156 | double child_y = parent->y; | 157 | double child_y = parent->y; |
157 | for (int i = 0; i < children->length; ++i) { | 158 | for (int i = 0; i < children->length; ++i) { |
158 | struct sway_container *child = children->items[i]; | 159 | struct sway_container *child = children->items[i]; |
160 | child->child_total_height = child_total_height; | ||
159 | child->x = parent->x; | 161 | child->x = parent->x; |
160 | child->y = child_y; | 162 | child->y = child_y; |
161 | child->width = parent->width; | 163 | child->width = parent->width; |
162 | child->height = floor(child->height_fraction * child_total_height); | 164 | child->height = round(child->height_fraction * child_total_height); |
163 | child_y += child->height + inner_gap; | 165 | child_y += child->height + inner_gap; |
164 | 166 | ||
165 | // Make last child use remaining height of parent | 167 | // Make last child use remaining height of parent |