mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-11 05:19:18 +03:00
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:
parent
66730eb138
commit
3921fcf173
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user