fix highlighting position

This commit is contained in:
unknown
2008-08-13 12:23:02 +02:00
parent d855987673
commit 3bee44ca7f

View File

@@ -241,6 +241,7 @@ void Menu::DeleteOption(int no)
void Menu::redraw_screen() void Menu::redraw_screen()
{ {
NeedsRedraw.clear();
vector<Option *>::const_iterator it = itsOptions.begin()+itsBeginning; vector<Option *>::const_iterator it = itsOptions.begin()+itsBeginning;
NeedsRedraw.reserve(itsHeight); NeedsRedraw.reserve(itsHeight);
for (int i = itsBeginning; i < itsBeginning+itsHeight && it != itsOptions.end(); i++, it++) for (int i = itsBeginning; i < itsBeginning+itsHeight && it != itsOptions.end(); i++, it++)
@@ -511,11 +512,7 @@ void Menu::Go(WHERE where)
void Menu::Highlight(int which) void Menu::Highlight(int which)
{ {
if (which <= itsOptions.size()) if (which <= itsOptions.size())
{
NeedsRedraw.push_back(itsHighlight);
itsHighlight = which-1; itsHighlight = which-1;
NeedsRedraw.push_back(itsHighlight);
}
else else
return; return;
@@ -523,6 +520,8 @@ void Menu::Highlight(int which)
itsBeginning = itsHighlight-itsHeight/2; itsBeginning = itsHighlight-itsHeight/2;
else else
itsBeginning = 0; itsBeginning = 0;
redraw_screen();
} }
void Menu::Reset() void Menu::Reset()