From 87b72a15aaaceb1f0501cb9544a0a857648f7d20 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 28 Mar 2016 22:56:05 +0200 Subject: A couple of cursor fixes --- src/frame.c | 3 ++- src/sc_editor.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/frame.c b/src/frame.c index 16d272f..f71e764 100644 --- a/src/frame.c +++ b/src/frame.c @@ -570,7 +570,8 @@ int find_cursor(struct frame *fr, double x, double y, /* Pretend it's in the last paragraph */ pos -= fr->paras[fr->n_paras-1]->height; *ppara = fr->n_paras - 1; - *ppos = text_para_pos(fr->paras[i], x - fr->pad_l, y - pos, ptrail); + *ppos = text_para_pos(fr->paras[fr->n_paras-1], + x - fr->pad_l, y - pos, ptrail); return 0; } diff --git a/src/sc_editor.c b/src/sc_editor.c index 05da7c9..379af90 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -411,6 +411,8 @@ static void draw_caret(cairo_t *cr, struct frame *fr, int cursor_para, return; } + cx += fr->x; + clow += fr->y; chigh = clow + h; cairo_move_to(cr, cx, clow); -- cgit v1.2.3