diff --git a/crates/torin/src/measure.rs b/crates/torin/src/measure.rs index bc0b7e6d4..21f475ca0 100644 --- a/crates/torin/src/measure.rs +++ b/crates/torin/src/measure.rs @@ -209,6 +209,9 @@ where let mut inner_sizes = Size2D::default(); + inner_sizes.width += node.padding.horizontal(); + inner_sizes.height += node.padding.vertical(); + if measure_inner_children && phase_measure_inner_children { // Create an area containing the available space inside the inner area let mut available_area = inner_area; @@ -621,7 +624,7 @@ where available_area.origin.x = child_area.max_x() + spacing.get(); available_area.size.width -= child_area.size.width + spacing.get(); - inner_sizes.height = child_area.height().max(inner_sizes.height); + inner_sizes.height = (child_area.height() + parent_node.padding.vertical()).max(inner_sizes.height); inner_sizes.width += child_area.width() + spacing.get(); // Keep the biggest height @@ -647,7 +650,7 @@ where available_area.origin.y = child_area.max_y() + spacing.get(); available_area.size.height -= child_area.size.height + spacing.get(); - inner_sizes.width = child_area.width().max(inner_sizes.width); + inner_sizes.width = (child_area.width() + parent_node.padding.horizontal()).max(inner_sizes.width); inner_sizes.height += child_area.height() + spacing.get(); // Keep the biggest width