- bugfix for popup menu in legacy font mode

This commit is contained in:
Mark Vejvoda 2011-10-05 02:12:53 +00:00
parent 555e88f464
commit e8663b99bc
2 changed files with 8 additions and 2 deletions

View File

@ -706,7 +706,7 @@ void PopupMenu::init(string menuHeader,std::vector<string> menuItems) {
int maxButtonWidth = -1;
for(unsigned int i = 0; i < menuItems.size(); ++i) {
int currentButtonWidth = -1;
if(font3D != NULL) {
if(font3D != NULL && Font::forceLegacyFonts == false) {
FontMetrics *fontMetrics= font3D->getMetrics();
if(fontMetrics) {
currentButtonWidth = fontMetrics->getTextWidth(menuItems[i]);

View File

@ -7000,10 +7000,16 @@ void Renderer::renderPopupMenu(PopupMenu *menu) {
}
else {
//text
int renderX = (menu->getX() + (menu->getW() / 2));
//int renderY = (menu->getY() + (menu->getH() / 2));
FontMetrics *fontMetrics= menu->getFont()->getMetrics();
int renderY = menu->getY() + menu->getH() - fontMetrics->getHeight();
renderTextShadow(
menu->getHeader(), menu->getFont(),fontColor,
menu->getX()+15, menu->getY()+93*menu->getH()/100,
renderX, renderY,
true);
//renderText(button->getText(), button->getFont(), color,x + (w / 2), y + (h / 2), true);
}
//buttons