fix NCursesClient::show_menu with big menu entries

This commit is contained in:
Maxime Coste 2012-09-05 00:37:09 +02:00
parent bdaa083c88
commit 3f64c36654

View File

@ -223,7 +223,7 @@ void NCursesClient::show_menu(const memoryview<String>& choices)
int max_x,max_y; int max_x,max_y;
getmaxyx(stdscr, max_y, max_x); getmaxyx(stdscr, max_y, max_x);
int columns = max_x / (int)longest; int columns = max_x / std::min(max_x, (int)longest);
int lines = std::min(10, (int)ceilf((float)m_choices.size()/columns)); int lines = std::min(10, (int)ceilf((float)m_choices.size()/columns));
m_menu = new_menu(&m_items[0]); m_menu = new_menu(&m_items[0]);