ui min sizes, fixes to slider viz

This commit is contained in:
Ryan Fleury
2025-04-14 10:49:36 -07:00
parent b98f2b153e
commit 550950ed46
6 changed files with 54 additions and 6 deletions
+8 -1
View File
@@ -1757,7 +1757,6 @@ ui_layout_enforce_constraints__in_place_rec(UI_Box *root, Axis2 axis)
}
}
}
}
//- rjf: fixup children sizes (in the direction of the layout axis)
@@ -1825,6 +1824,12 @@ ui_layout_enforce_constraints__in_place_rec(UI_Box *root, Axis2 axis)
}
}
//- rjf: enforce clamps
for(UI_Box *child = root->first; !ui_box_is_nil(child); child = child->next)
{
child->fixed_size.v[axis] = Max(child->fixed_size.v[axis], child->min_size.v[axis]);
}
//- rjf: recurse
for(UI_Box *child = root->first; !ui_box_is_nil(child); child = child->next)
{
@@ -2424,6 +2429,8 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
{
box->pref_size[Axis2_Y] = ui_state->pref_height_stack.top->v;
}
box->min_size.v[Axis2_X] = ui_state->min_width_stack.top->v;
box->min_size.v[Axis2_Y] = ui_state->min_height_stack.top->v;
B32 is_auto_focus_active = ui_is_key_auto_focus_active(key);
B32 is_auto_focus_hot = ui_is_key_auto_focus_hot(key);