summaryrefslogtreecommitdiff
path: root/amiga/font.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-14 22:48:25 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-14 22:48:25 +0000
commit3921fcf1736b419712c6202c97572446cfd3049f (patch)
tree21e10ed1d21d80100778dd6b9de9d77d5dd95db2 /amiga/font.c
parent66730eb138859df1e889c34f7f61d163cb1638d5 (diff)
downloadnetsurf-3921fcf1736b419712c6202c97572446cfd3049f.tar.gz
netsurf-3921fcf1736b419712c6202c97572446cfd3049f.tar.bz2
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
Diffstat (limited to 'amiga/font.c')
-rw-r--r--amiga/font.c5
1 files 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;