Skip to content

Commit

Permalink
WAGE: Fix menu dropdown dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 13, 2016
1 parent b911c63 commit a1e9c82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions engines/wage/gui.h
Expand Up @@ -67,8 +67,8 @@ enum {
kMenuHeight = 20,
kMenuLeftMargin = 7,
kMenuSpacing = 13,
kMenuPadding = 6,
kMenuDropdownPadding = 6,
kMenuPadding = 16,
kMenuDropdownPadding = 12,
kMenuDropdownItemHeight = 19,
kMenuItemHeight = 20,
kBorderWidth = 17,
Expand Down
8 changes: 4 additions & 4 deletions engines/wage/menu.cpp
Expand Up @@ -226,10 +226,10 @@ int Menu::calculateMenuWidth(MenuItem *menu) {
void Menu::calcMenuBounds(MenuItem *menu) {
// TODO: cache maxWidth
int maxWidth = calculateMenuWidth(menu);
int x1 = menu->bbox.left - kMenuDropdownPadding;
int x1 = menu->bbox.left;
int y1 = menu->bbox.bottom;
int x2 = x1 + maxWidth + kMenuDropdownPadding * 3;
int y2 = y1 + menu->subitems.size() * kMenuDropdownItemHeight;
int x2 = x1 + maxWidth + kMenuDropdownPadding * 2;
int y2 = y1 + menu->subitems.size() * kMenuDropdownItemHeight - 3;

menu->subbbox.left = x1;
menu->subbbox.top = y1;
Expand Down Expand Up @@ -272,7 +272,7 @@ void Menu::renderSubmenu(MenuItem *menu) {
Design::drawFilledRect(&_gui->_screen, *r, kColorWhite, _patterns, 1);
Design::drawRect(&_gui->_screen, *r, 1, kColorBlack, _patterns, 1);

int x = r->left + kMenuLeftMargin;
int x = r->left + kMenuDropdownPadding;
int y = r->top;
for (int i = 0; i < menu->subitems.size(); i++) {
_font->drawString(&_gui->_screen, menu->subitems[i]->text, x, y, r->width(), kColorBlack);
Expand Down

0 comments on commit a1e9c82

Please sign in to comment.