draw border around floating divs

c3
Alessandro Mauri 1 week ago
parent 3a7655a3f0
commit 2e0c6333d3
  1. 3
      src/ugui_div.c3
  2. 3
      src/ugui_impl.c3

@ -39,7 +39,8 @@ fn void! Ctx.div_begin(&ctx, String label, Rect size)
} }
// Add the background to the draw stack // Add the background to the draw stack
ctx.push_rect(c_elem.bounds, c_elem.div.color_bg)!; bool do_border = parent.div.layout == LAYOUT_FLOATING;
ctx.push_rect(c_elem.bounds, c_elem.div.color_bg, do_border: do_border)!;
// TODO: check active // TODO: check active
// TODO: check resizeable // TODO: check resizeable

@ -120,6 +120,9 @@ fn void! Ctx.force_update(&ctx)
fn void! Ctx.frame_end(&ctx) fn void! Ctx.frame_end(&ctx)
{ {
Elem* root = ctx.get_elem_by_tree_idx(0)!;
root.div.layout = LAYOUT_ROW;
// 1. clear the tree // 1. clear the tree
ctx.tree.prune(0)!; ctx.tree.prune(0)!;

Loading…
Cancel
Save