BUGFIX: crashed when menu entry wider than 19 chars
This commit is contained in:
parent
4ba4908f01
commit
74eceacf7e
@ -24,7 +24,7 @@ namespace floatpump::menu {
|
|||||||
|
|
||||||
list.reserve(m_submenus.size() + m_entries.size());
|
list.reserve(m_submenus.size() + m_entries.size());
|
||||||
|
|
||||||
//Append al Submenus
|
//Append all Submenus
|
||||||
for (auto &m_submenu: m_submenus) {
|
for (auto &m_submenu: m_submenus) {
|
||||||
list.push_back(m_submenu->printLine());
|
list.push_back(m_submenu->printLine());
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,8 @@ namespace floatpump {
|
|||||||
//We have 19 characters width for displaying the entry -> fill with spaces
|
//We have 19 characters width for displaying the entry -> fill with spaces
|
||||||
int spaces = 19 - (m_name.length() + m_type.toString().length());
|
int spaces = 19 - (m_name.length() + m_type.toString().length());
|
||||||
std::string spacer;
|
std::string spacer;
|
||||||
spacer.append(spaces, ' ');
|
if(spaces > 0)
|
||||||
|
spacer.append(spaces, ' ');
|
||||||
return m_name + spacer + m_type.toString();
|
return m_name + spacer + m_type.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user