rows and columns must be >= 1
This commit is contained in:
parent
afd584566c
commit
b4ae0d5377
@ -405,10 +405,8 @@ void Window::resize()
|
||||
m_shaders.flat->set_viewport_size(m_width, m_height);
|
||||
m_shaders.rect->use();
|
||||
m_shaders.rect->set_viewport_size(m_width, m_height);
|
||||
m_columns = m_width / m_font.get_advance();
|
||||
if (m_columns < 1)
|
||||
m_columns = 1;
|
||||
m_rows = (m_height - 2) / m_font.get_line_height();
|
||||
m_columns = std::max(1, m_width / m_font.get_advance());
|
||||
m_rows = std::max(1, (m_height - 2) / m_font.get_line_height());
|
||||
}
|
||||
|
||||
void Window::redraw()
|
||||
|
Loading…
x
Reference in New Issue
Block a user