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
This commit is contained in:
Chris Young 2010-03-14 22:48:25 +00:00
parent 66730eb138
commit 3921fcf173

View File

@ -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;