From 3921fcf1736b419712c6202c97572446cfd3049f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 14 Mar 2010 22:48:25 +0000 Subject: [PATCH] Fix character offset, which was one character left of where the user clicked even though the caret itself was placed in the correct location. svn path=/trunk/netsurf/; revision=10128 --- amiga/font.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/amiga/font.c b/amiga/font.c index 1862caa38..162fce6d7 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -114,6 +114,8 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, else utf16charlen = 2; + utf8len = utf8_char_byte_length(string); + if(ESetInfo(&ofont->olf_EEngine, OT_GlyphCode,*utf16, TAG_END) == OTERR_Success) @@ -140,12 +142,11 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, } } - utf8len = utf8_char_byte_length(string); string += utf8len; utf16 += utf16charlen; } - if(co == (length - 1)) + if(co == (length)) { *actual_x = tx; co = length;