Got support for persistent ordering of UI_Boxes using UI_FloatingManager

This commit is contained in:
2024-05-13 16:07:49 -04:00
parent 0744069b0d
commit adc75f6977
10 changed files with 271 additions and 172 deletions

View File

@ -116,15 +116,10 @@ render_mode_2d_workspace :: proc()
state.ui_context = ui
current := root.first
for ; current != nil; current = ui_box_tranverse_next( current, is_destructive = true )
for ; current != nil; current = ui_box_tranverse_next( current )
{
// profile("Box")
parent := current.parent
if parent == ui.root && current.ancestors == -1 {
// This is a deceased rooted box
// Ignore it as its not constructed this frame
continue
}
layout := current.layout
style := current.style
@ -344,18 +339,10 @@ render_screen_ui :: proc()
// Sort roots children by top-level order
current := root.first
for ; current != nil; current = ui_box_tranverse_next( current, is_destructive = false )
for ; current != nil; current = ui_box_tranverse_next( current )
{
// profile("Box")
parent := current.parent
if parent == ui.root && current.ancestors == -1 {
// current.parent = nil
// current.first = nil
// current.last = nil
// This is a deceased rooted box
// Ignore it as its not constructed this frame
continue
}
style := current.style
layout := current.layout