UI fun
This commit is contained in:
17
ui/ui.jai
17
ui/ui.jai
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user