start on gap buffer drawing
This commit is contained in:
parent
b4ae0d5377
commit
1e2aae4136
@ -378,6 +378,30 @@ void Window::update_cursor_row()
|
|||||||
void Window::draw_buffer()
|
void Window::draw_buffer()
|
||||||
{
|
{
|
||||||
update_cursor_row();
|
update_cursor_row();
|
||||||
|
int screen_row = m_cursor_row - m_cursor->column() / m_columns;
|
||||||
|
GapBuffer::Cursor draw_cursor = *m_cursor;
|
||||||
|
draw_cursor.go_start_of_line();
|
||||||
|
while ((screen_row > 0) && draw_cursor.go_up(0u))
|
||||||
|
{
|
||||||
|
GapBuffer::Cursor cursor2 = draw_cursor;
|
||||||
|
cursor2.go_end_of_line(false);
|
||||||
|
screen_row -= (1 + cursor2.column() / m_columns);
|
||||||
|
}
|
||||||
|
while (screen_row < m_rows)
|
||||||
|
{
|
||||||
|
draw_buffer_line(screen_row, draw_cursor);
|
||||||
|
draw_cursor.go_end_of_line(false);
|
||||||
|
screen_row += (1 + draw_cursor.column() / m_columns);
|
||||||
|
if (!draw_cursor.go_down(0u))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::draw_buffer_line(int screen_row, const GapBuffer::Cursor & cursor)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::draw_buffer_character(int screen_column, int screen_row, uint32_t character)
|
void Window::draw_buffer_character(int screen_column, int screen_row, uint32_t character)
|
||||||
|
@ -45,6 +45,7 @@ protected:
|
|||||||
void handle_keyval(uint32_t keyval);
|
void handle_keyval(uint32_t keyval);
|
||||||
void cursor_move(int which);
|
void cursor_move(int which);
|
||||||
void draw_buffer();
|
void draw_buffer();
|
||||||
|
void draw_buffer_line(int screen_row, const GapBuffer::Cursor & cursor);
|
||||||
void draw_buffer_character(int screen_column, int screen_row, uint32_t character);
|
void draw_buffer_character(int screen_column, int screen_row, uint32_t character);
|
||||||
void draw_character(int x, int y, uint32_t character);
|
void draw_character(int x, int y, uint32_t character);
|
||||||
void update_cursor_row();
|
void update_cursor_row();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user