aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-06-21 18:04:58 +0200
committerThomas White <taw@bitwiz.org.uk>2014-06-21 18:04:58 +0200
commit10d05eeeb2705c3918e27a98253e95a2d50fe189 (patch)
tree848ec0c2d7be583aff7b11815cb64dc079764a01 /src/wrap.c
parentb36421467b4669dec503714bbf7be13fcfadc04e (diff)
Mostly working cursor logic
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wrap.c b/src/wrap.c
index 084bf24..8c81295 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -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,
- box->len_bytes,
+ strlen(box_text),
&box->item->analysis, pos,
FALSE, &p);
*xposd += pango_units_to_double(p);
@@ -311,7 +311,7 @@ void find_cursor(struct frame *fr, double xposd, double yposd,
box_text = g_utf8_offset_to_pointer(block_text, b->offs_char);
/* cast because this function is not const-clean */
pango_glyph_string_x_to_index(b->glyphs, (char *)box_text,
- b->len_bytes,
+ strlen(box_text),
&b->item->analysis,
x_pos_i, &idx, &trail);
offs = idx + trail;