mostly formatting/name changes and other misc stuff

This commit is contained in:
2024-06-28 03:27:25 -04:00
parent 43415446b0
commit 12741a228d
8 changed files with 67 additions and 67 deletions

View File

@ -225,7 +225,7 @@ ui_graph_build_end :: proc( ui : ^UI_State )
// Auto-layout and initial render_queue generation
render_queue := array_to_slice(ui.render_queue)
for current := root.first; current != nil; current = ui_box_tranverse_next_depth_based( current )
for current := root.first; current != nil; current = ui_box_tranverse_next_depth_first( current )
{
if ! current.computed.fresh {
ui_box_compute_layout( current )

View File

@ -118,7 +118,7 @@ ui_prev_cached_box :: #force_inline proc( box : ^UI_Box ) -> ^UI_Box { return hm
// TODO(Ed): Rename to ui_box_tranverse_view_next
// Traveral pritorizes immeidate children
ui_box_tranverse_next_depth_based :: #force_inline proc "contextless" ( box : ^ UI_Box, bypass_intersection_test := false ) -> (^ UI_Box)
ui_box_tranverse_next_depth_first :: #force_inline proc "contextless" ( box : ^ UI_Box, bypass_intersection_test := false ) -> (^ UI_Box)
{
using state := get_state()
// If current has children, do them first
@ -151,7 +151,7 @@ ui_box_tranverse_next_depth_based :: #force_inline proc "contextless" ( box : ^
}
// Traveral pritorizes traversing a "anestry layer"
ui_box_traverse_next_layer_based :: proc "contextless" ( box : ^UI_Box, bypass_intersection_test := false, ctx : ^UI_State = nil ) -> (^UI_Box)
ui_box_traverse_next_breadth_first :: proc "contextless" ( box : ^UI_Box, bypass_intersection_test := false, ctx : ^UI_State = nil ) -> (^UI_Box)
{
ctx := ctx
if ctx == nil {

View File

@ -168,7 +168,7 @@ ui_box_compute_layout :: proc( box : ^UI_Box,
{
content_size := content_bounds.max - content_bounds.min
text_pos : Vec2
text_pos = content_bounds.min + { 0, 0 }
text_pos = content_bounds.min + { 0, text_size.y * 0.5 }
text_pos += (content_size - text_size) * layout.text_alignment
computed.text_size = text_size
@ -184,7 +184,7 @@ ui_compute_children_bounding_area :: proc ( box : ^UI_Box )
ui_box_compute_layout_children :: proc( box : ^UI_Box )
{
for current := box.first; current != nil && current.prev != box; current = ui_box_tranverse_next_depth_based( current )
for current := box.first; current != nil && current.prev != box; current = ui_box_tranverse_next_depth_first( current )
{
if current == box do return
if current.computed.fresh do continue