mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +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;
|
++numvalidentries;
|
||||||
|
|
||||||
// assumes height == font->get_yline()!
|
// 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);
|
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)
|
if (entry == NULL)
|
||||||
continue;
|
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;
|
y += height;
|
||||||
totalHeight = y;
|
totalHeight = y;
|
||||||
|
@ -4042,7 +4042,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
|
||||||
if (dodraw)
|
if (dodraw)
|
||||||
textsize = Menu_Text(origin.x + x, origin.y + y_upper + y - menu->scrollPos, entry->font, entry->name, status, ydim_upper, ydim_lower);
|
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)
|
if (entry->format->width < 0)
|
||||||
status |= MT_XRight;
|
status |= MT_XRight;
|
||||||
|
|
|
@ -324,6 +324,11 @@ typedef struct MenuEntry_t
|
||||||
|
|
||||||
int32_t getMarginBottom() const { return scale(format->marginBottom, font->zoom, 65536); }
|
int32_t getMarginBottom() const { return scale(format->marginBottom, font->zoom, 65536); }
|
||||||
int32_t getIndent() const { return scale(format->indent, 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;
|
} MenuEntry_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue