From 96dbdea21ee003de17c04ea4aedad57574b64e4f Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 15 Jul 2022 01:01:04 +0200 Subject: [PATCH] gui: Update elements in reverse order This allows to calculate dimensions for containers with children containers in it. --- src/gui/src/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/gui.c b/src/gui/src/gui.c index f65ed91..022ce73 100644 --- a/src/gui/src/gui.c +++ b/src/gui/src/gui.c @@ -79,10 +79,10 @@ void gui_add_child(struct gui_common *const p, int gui_update(struct gui_common *const g, const union peripheral *const p, const struct camera *const c) { - if (g->cb && g->cb->update && g->cb->update(g, p, c)) + if (g->child && gui_update(g->child, p, c)) return -1; - if (g->child && gui_update(g->child, p, c)) + if (g->cb && g->cb->update && g->cb->update(g, p, c)) return -1; for (struct gui_common *s = g->sibling; s; s = s->sibling)