[PATCH] cursor in editor.c now goes to a newline

Pekka Paalanen ppaalanen at gmail.com
Tue Jun 11 02:58:23 PDT 2013


On Mon, 10 Jun 2013 22:18:12 +0200
blackwolf12333 <blackwolf12333 at gmail.com> wrote:

> ---
>  clients/editor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/clients/editor.c b/clients/editor.c
> index d4e4e92..df82ed0 100644
> --- a/clients/editor.c
> +++ b/clients/editor.c
> @@ -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) + 20);
> +	cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y));
>  	cairo_stroke(cr);
>  }
>  

Hi,

where does the +20 come from? Is it related to font size?
Could Pango tell us the proper height so it matches the font?

Would it be more correct to just add cursor_pos.y in the old code?


Thanks,
pq


More information about the wayland-devel mailing list