Window: rename m_chars_per_line -> m_columns
This commit is contained in:
parent
dc71520a88
commit
862b414c1d
@ -253,9 +253,9 @@ void Window::resize()
|
|||||||
glViewport(0, 0, m_width, m_height);
|
glViewport(0, 0, m_width, m_height);
|
||||||
m_programs.text->use();
|
m_programs.text->use();
|
||||||
m_programs.text->set_viewport_size(m_width, m_height);
|
m_programs.text->set_viewport_size(m_width, m_height);
|
||||||
m_chars_per_line = m_width / m_font.get_advance();
|
m_columns = m_width / m_font.get_advance();
|
||||||
if (m_chars_per_line < 1)
|
if (m_columns < 1)
|
||||||
m_chars_per_line = 1;
|
m_columns = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::redraw()
|
void Window::redraw()
|
||||||
@ -279,7 +279,7 @@ void Window::redraw()
|
|||||||
auto g = m_font.get_glyph(c);
|
auto g = m_font.get_glyph(c);
|
||||||
m_programs.text->set_position(x, y);
|
m_programs.text->set_position(x, y);
|
||||||
g->render();
|
g->render();
|
||||||
if ((i + 1) % m_chars_per_line == 0)
|
if ((i + 1) % m_columns == 0)
|
||||||
{
|
{
|
||||||
y -= line_height;
|
y -= line_height;
|
||||||
x = 0;
|
x = 0;
|
||||||
|
@ -30,7 +30,7 @@ protected:
|
|||||||
} m_programs;
|
} m_programs;
|
||||||
|
|
||||||
Font m_font;
|
Font m_font;
|
||||||
int m_chars_per_line;
|
int m_columns;
|
||||||
|
|
||||||
std::shared_ptr<Buffer> m_buffer;
|
std::shared_ptr<Buffer> m_buffer;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user