We didn't calculate the correct cell number when drawing a cell. Fix that.
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
*/
void kmscon_console_draw(struct kmscon_console *con)
{
- size_t i, j;
+ size_t i, j, pos;
double xs, ys, x, y;
if (!con || !con->cr)
for (i = 0; i < con->lines_y; ++i) {
x = 0;
for (j = 0; j < con->lines_x; ++j) {
- kmscon_font_draw(con->font, con->cells[i].ch, con->cr,
+ pos = i * con->lines_x + j;
+ kmscon_font_draw(con->font, con->cells[pos].ch, con->cr,
x, y);
x += xs;
}