Auto bugfix
This commit is contained in:
parent
e5769bf5fc
commit
9db12745b2
1 changed files with 5 additions and 15 deletions
18
ui.odin
18
ui.odin
|
|
@ -123,22 +123,12 @@ container_end :: proc() {
|
|||
container_index := pop(&ctx.containers)
|
||||
container := &ctx.elements[container_index]
|
||||
pop(&ctx.container_last_element)
|
||||
|
||||
_, width_is_auto := container.dimensions.width.(Size_Auto)
|
||||
_, height_is_auto := container.dimensions.height.(Size_Auto)
|
||||
if width_is_auto || height_is_auto {
|
||||
content_size: v2
|
||||
#reverse for element in ctx.elements[container_index + 1:] {
|
||||
content_size += rect_get_size(get_element_outer_area(element))
|
||||
if _, width_is_auto := container.dimensions.width.(Size_Auto); width_is_auto {
|
||||
container.area.width = rect_get_br(get_element_outer_area(_element_previous()^)).x - container.area.x
|
||||
}
|
||||
if width_is_auto {
|
||||
container.area.width = content_size.x
|
||||
if _, height_is_auto := container.dimensions.height.(Size_Auto); height_is_auto {
|
||||
container.area.height = rect_get_br(get_element_outer_area(_element_previous()^)).y - container.area.y
|
||||
}
|
||||
if height_is_auto {
|
||||
container.area.height = content_size.y
|
||||
}
|
||||
}
|
||||
|
||||
ctx.same_line = false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue