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>
This commit is contained in:
David Herrmann 2011-12-01 18:33:49 +01:00
parent 0b6a81d901
commit 6072bf445f

View File

@ -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;
}