From 2e0c6333d38a0fb886017ded1bc42793d610cf90 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Mon, 16 Dec 2024 17:06:16 +0100 Subject: [PATCH] draw border around floating divs --- src/ugui_div.c3 | 3 ++- src/ugui_impl.c3 | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ugui_div.c3 b/src/ugui_div.c3 index 657babe..3706c34 100644 --- a/src/ugui_div.c3 +++ b/src/ugui_div.c3 @@ -39,7 +39,8 @@ fn void! Ctx.div_begin(&ctx, String label, Rect size) } // 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 resizeable diff --git a/src/ugui_impl.c3 b/src/ugui_impl.c3 index 541dfb7..e2da44a 100644 --- a/src/ugui_impl.c3 +++ b/src/ugui_impl.c3 @@ -120,6 +120,9 @@ fn void! Ctx.force_update(&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 ctx.tree.prune(0)!;