diff options
author | Thomas White <taw@bitwiz.org.uk> | 2014-06-21 22:52:01 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2014-06-21 22:52:01 +0200 |
commit | c8c48c4a22953c2da38e9947e56fbce0fde78cec (patch) | |
tree | 7404a476893cf514d0e89e60d68c9a5e2a13c1dc /src | |
parent | 10d05eeeb2705c3918e27a98253e95a2d50fe189 (diff) |
Fix cursor moving
Diffstat (limited to 'src')
-rw-r--r-- | src/wrap.c | 9 | ||||
-rw-r--r-- | src/wrap.h | 2 |
2 files changed, 8 insertions, 3 deletions
@@ -119,7 +119,7 @@ static struct wrap_line *get_cursor_line(struct frame *fr, size_t pos, } #endif -void get_cursor_pos(struct wrap_box *box, size_t pos, +void get_cursor_pos(struct wrap_box *box, int pos, double *xposd, double *yposd, double *line_height) { int p; @@ -146,7 +146,7 @@ void get_cursor_pos(struct wrap_box *box, size_t pos, box_text = g_utf8_offset_to_pointer(block_text, box->offs_char); /* cast because this function is not const-clean */ pango_glyph_string_index_to_x(box->glyphs, (char *)box_text, - strlen(box_text), + box->item->length, &box->item->analysis, pos, FALSE, &p); *xposd += pango_units_to_double(p); @@ -158,6 +158,11 @@ void get_cursor_pos(struct wrap_box *box, size_t pos, } /* else zero */ break; + case WRAP_BOX_NOTHING : + case WRAP_BOX_SENTINEL : + *xposd = 0.0; + break; + } } @@ -102,7 +102,7 @@ struct wrap_line extern int wrap_contents(struct frame *fr); -extern void get_cursor_pos(struct wrap_box *box, size_t pos, +extern void get_cursor_pos(struct wrap_box *box, int pos, double *xposd, double *yposd, double *line_height); extern void move_cursor_back(struct presentation *p); |