diff options
| author | Arslaan Pathan <[email protected]> | 2026-04-22 21:43:40 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-04-22 21:44:18 +1200 |
| commit | a2252b2952e4027b7edb420dccbd8494ae822b0f (patch) | |
| tree | f42e9c405d64378399d071d1812f5e97beab849d /src | |
| parent | e72af15990e16539ae0d68d7824deae8e1e3d2a6 (diff) | |
| download | saffron-a2252b2952e4027b7edb420dccbd8494ae822b0f.tar.xz saffron-a2252b2952e4027b7edb420dccbd8494ae822b0f.zip | |
[chore] Add some basic docs for my benefit, [feat/QoL] make adding children to boxes relayout automatically
Diffstat (limited to 'src')
| -rw-r--r-- | src/saffron_widget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/saffron_widget.c b/src/saffron_widget.c index 779253b..b673e48 100644 --- a/src/saffron_widget.c +++ b/src/saffron_widget.c @@ -66,6 +66,10 @@ void saffron_widget_add_child(SaffronWidget *parent, SaffronWidget *child) { parent->children = realloc(parent->children, sizeof(SaffronWidget*) * (parent->child_count + 1)); parent->children[parent->child_count] = child; parent->child_count++; + + if (parent->type == SAFFRON_WIDGET_BOX) { + saffron_box_layout((SaffronBox*)parent); + } } SaffronWidget* saffron_widget_hit_test(SaffronWidget* widget, int x, int y) { |
