clients/editor.c: Draw cursor at correct verical position
authorPeter Maatman <blackwolf12333@gmail.com>
Sat, 6 Jul 2013 18:55:54 +0000 (20:55 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 9 Jul 2013 23:43:53 +0000 (19:43 -0400)
With this patch, the editor cursor now moves up and down correctly
instead of having the top part stuck on the first line.

clients/editor.c

index 5e8ae8e..7e69403 100644 (file)
@@ -946,8 +946,8 @@ text_entry_draw_cursor(struct text_entry *entry, cairo_t *cr)
                                    &cursor_pos, NULL);
 
        cairo_set_line_width(cr, 1.0);
-       cairo_move_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(extents.height) + 2);
-       cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), - 2);
+       cairo_move_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y));
+       cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y) + PANGO_PIXELS(cursor_pos.height));
        cairo_stroke(cr);
 }