fix a bug in Display::SongInColumns() that sometimes corrupted last column
This commit is contained in:
@@ -39,10 +39,10 @@ std::string Display::Columns()
|
|||||||
|
|
||||||
for (std::vector<Column>::const_iterator it = Config.columns.begin(); it != Config.columns.end(); ++it)
|
for (std::vector<Column>::const_iterator it = Config.columns.begin(); it != Config.columns.end(); ++it)
|
||||||
{
|
{
|
||||||
if (last_fixed && it == next2last)
|
if (it == Config.columns.end()-1)
|
||||||
width = COLS-where-(++next2last)->width;
|
|
||||||
else if (it == Config.columns.end()-1)
|
|
||||||
width = COLS-where;
|
width = COLS-where;
|
||||||
|
else if (last_fixed && it == next2last)
|
||||||
|
width = COLS-where-(++next2last)->width;
|
||||||
else
|
else
|
||||||
width = it->width*(it->fixed ? 1 : COLS/100.0);
|
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;
|
*menu << clEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_fixed && it == next2last)
|
if (it == Config.columns.end()-1)
|
||||||
width = COLS-where-(++next2last)->width;
|
|
||||||
else if (it == Config.columns.end()-1)
|
|
||||||
width = menu->GetWidth()-where;
|
width = menu->GetWidth()-where;
|
||||||
|
else if (last_fixed && it == next2last)
|
||||||
|
width = COLS-where-(++next2last)->width;
|
||||||
else
|
else
|
||||||
width = it->width*(it->fixed ? 1 : COLS/100.0);
|
width = it->width*(it->fixed ? 1 : COLS/100.0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user