This commit is contained in:
2025-01-02 16:35:53 +01:00
parent 834de24444
commit 03b84515e7
5 changed files with 100 additions and 68 deletions

View File

@@ -582,6 +582,14 @@ ui_figure_out_sizes :: () {
}
}
// Align children in parent
//for *box: ui_state.boxes {
// if box.parent != null {
// if box.parent.rect.h > box.rect.h && box.parent.layout.alignment == .CENTERED {
// box.rect.y = box.rect.y
// }
// }
//}
// Find final positions
for *box : ui_state.boxes {
@@ -656,8 +664,13 @@ ui_set_rect_recursively :: (parent: *UI_Box) {
while child != null {
defer child = child.next;
child.rect.x = starting_offset_x;
child.rect.y = starting_offset_y;
if parent.layout.alignment == .CENTERED {
} else {
child.rect.x = starting_offset_x;
child.rect.y = starting_offset_y;
}
child.rect.w = child.size.x;
child.rect.h = child.size.y;