gui: Update elements in reverse order

This allows to calculate dimensions for containers with children
containers in it.
This commit is contained in:
Xavier Del Campo Romero 2022-07-15 01:01:04 +02:00
parent 1ea5a4d4a4
commit 96dbdea21e
1 changed files with 2 additions and 2 deletions

View File

@ -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)