fix a bug in Display::SongInColumns() that sometimes corrupted last column

This commit is contained in:
Andrzej Rybczak
2010-02-19 12:44:40 +01:00
parent 68fa910c78
commit 4bd9e9af79

View File

@@ -39,10 +39,10 @@ std::string Display::Columns()
for (std::vector<Column>::const_iterator it = Config.columns.begin(); it != Config.columns.end(); ++it)
{
if (last_fixed && it == next2last)
width = COLS-where-(++next2last)->width;
else if (it == Config.columns.end()-1)
if (it == Config.columns.end()-1)
width = COLS-where;
else if (last_fixed && it == next2last)
width = COLS-where-(++next2last)->width;
else
width = it->width*(it->fixed ? 1 : COLS/100.0);
@@ -146,10 +146,10 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu<MPD::Song> *menu)
*menu << clEnd;
}
if (last_fixed && it == next2last)
width = COLS-where-(++next2last)->width;
else if (it == Config.columns.end()-1)
if (it == Config.columns.end()-1)
width = menu->GetWidth()-where;
else if (last_fixed && it == next2last)
width = COLS-where-(++next2last)->width;
else
width = it->width*(it->fixed ? 1 : COLS/100.0);