menu: fix breakage caused by f857aea8

This commit is contained in:
Johan Malm 2021-08-09 17:28:39 +01:00
parent 0e57c65393
commit 9a9cd609f6
3 changed files with 29 additions and 17 deletions

View file

@ -231,16 +231,19 @@ menu_finish(struct menu *menu)
void
menu_move(struct menu *menu, int x, int y)
{
menu->x = x;
menu->y = y;
menu->box.x = x;
menu->box.y = y;
int offset = 0;
struct menuitem *menuitem;
wl_list_for_each_reverse (menuitem, &menu->menuitems, link) {
menuitem->box.x = menu->x;
menuitem->box.y = menu->y + offset;
menuitem->box.x = menu->box.x;
menuitem->box.y = menu->box.y + offset;
offset += menuitem->box.height;
}
menu->box.width = MENUWIDTH;
menu->box.height = offset;
}
void