Additional scaling issues fixes + bug fix by Zeth in SimpleMenu

This commit is contained in:
wagic.the.homebrew
2012-03-21 14:58:53 +00:00
parent a581d1bba3
commit bdec6c6b7d

View File

@@ -137,8 +137,12 @@ void SimpleMenu::Render()
float width = (static_cast<SimpleMenuItem*> (mObjects[i]))->GetEnlargedWidth() + 15;
if (mWidth < width) mWidth = width;
}
float scaleFactor = titleFont->GetScale();
titleFont->SetScale(SCALE_NORMAL);
if ((!title.empty()) && (mWidth < titleFont->GetStringWidth(title.c_str())))
mWidth = titleFont->GetStringWidth(title.c_str());
titleFont->SetScale(scaleFactor);
mWidth += 2 * kHorizontalMargin;
if (mCenterHorizontal)
@@ -249,7 +253,8 @@ bool SimpleMenu::CheckUserInput(JButton key)
}
else if (y > mHeight) // this will scroll downwards in a list.
{
n = mCurr + 1;
if (mCurr < mCount-1)
n = mCurr + 1;
}
}
}