mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
Scale menu spacers by font zoom.
git-svn-id: https://svn.eduke32.com/eduke32@6199 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d85cbcc8cf
commit
57b5a47b9d
2 changed files with 8 additions and 3 deletions
|
@ -3984,7 +3984,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
|
|||
++numvalidentries;
|
||||
|
||||
// assumes height == font->get_yline()!
|
||||
totalheight += entry->type == Spacer ? ((MenuSpacer_t*)entry->entry)->height : entry->font->get_yline();
|
||||
totalheight += entry->type == Spacer ? entry->getSpacerHeight() : entry->font->get_yline();
|
||||
}
|
||||
|
||||
calculatedentryspacing = (klabs(menu->format->bottomcutoff) - menu->format->pos.y - totalheight) / (numvalidentries > 1 ? numvalidentries - 1 : 1);
|
||||
|
@ -3998,7 +3998,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
|
|||
if (entry == NULL)
|
||||
continue;
|
||||
|
||||
int32_t const height = entry->type == Spacer ? ((MenuSpacer_t*)entry->entry)->height : entry->font->get_yline();
|
||||
int32_t const height = entry->type == Spacer ? entry->getSpacerHeight() : entry->font->get_yline();
|
||||
|
||||
y += height;
|
||||
totalHeight = y;
|
||||
|
@ -4042,7 +4042,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
|
|||
if (dodraw)
|
||||
textsize = Menu_Text(origin.x + x, origin.y + y_upper + y - menu->scrollPos, entry->font, entry->name, status, ydim_upper, ydim_lower);
|
||||
|
||||
height = entry->type == Spacer ? ((MenuSpacer_t*)entry->entry)->height : entry->font->get_yline(); // max(textsize.y, entry->font->get_yline()); // bluefont Q ruins this
|
||||
height = entry->type == Spacer ? entry->getSpacerHeight() : entry->font->get_yline(); // max(textsize.y, entry->font->get_yline()); // bluefont Q ruins this
|
||||
|
||||
if (entry->format->width < 0)
|
||||
status |= MT_XRight;
|
||||
|
|
|
@ -324,6 +324,11 @@ typedef struct MenuEntry_t
|
|||
|
||||
int32_t getMarginBottom() const { return scale(format->marginBottom, font->zoom, 65536); }
|
||||
int32_t getIndent() const { return scale(format->indent, font->zoom, 65536); }
|
||||
int32_t getSpacerHeight() const
|
||||
{
|
||||
Bassert(type == Spacer);
|
||||
return scale(((MenuSpacer_t *)entry)->height, font->zoom, 65536);
|
||||
}
|
||||
} MenuEntry_t;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue