From 4bd9e9af7995a0b91a4a4d9acdb11691907a8811 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 19 Feb 2010 12:44:40 +0100 Subject: [PATCH] fix a bug in Display::SongInColumns() that sometimes corrupted last column --- src/display.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index bf147a23..990180c8 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -39,10 +39,10 @@ std::string Display::Columns() for (std::vector::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 *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);