diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2011-12-01 18:33:49 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2011-12-01 18:33:49 +0100 |
commit | 6072bf445f69802840f8e079064923d6148aaeb4 (patch) | |
tree | 1b0073a5197089bc090763ba27c13712671d0598 | |
parent | 0b6a81d90191a20b7ae103f299a4f26964dd5828 (diff) |
Console: Fix cell-selection when drawing glyphs
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>
-rw-r--r-- | src/console.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/console.c b/src/console.c index d3f4c31..bd9514b 100644 --- a/src/console.c +++ b/src/console.c @@ -226,7 +226,7 @@ err_free: */ 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) @@ -248,7 +248,8 @@ void kmscon_console_draw(struct kmscon_console *con) 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; } |