From 3d971835db366f97212d62b8944acfdfbfd357ef Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 5 Sep 2009 14:39:38 +0000 Subject: Click position improvements svn path=/trunk/netsurf/; revision=9541 --- amiga/font.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'amiga/font.c') diff --git a/amiga/font.c b/amiga/font.c index 80724429d..0c46350ac 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -115,7 +115,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, utf16charlen = 2; utf8len = utf8_char_byte_length(string); - string+=utf8len; + string += utf8len; if(ESetInfo(&ofont->olf_EEngine, OT_GlyphCode,*utf16, @@ -125,8 +125,9 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, OT_GlyphMap8Bit,&glyph, TAG_END) == 0) { - if(xglm_X1) + if(x < (tx + glyph->glm_X1)) { + *actual_x = tx; i = len+1; } else @@ -134,8 +135,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, co += utf8len; } - *actual_x = tx + (glyph->glm_X1 / 2); - tx+= glyph->glm_X1; + tx += glyph->glm_X1; EReleaseInfo(&ofont->olf_EEngine, OT_GlyphMap8Bit,glyph, @@ -144,8 +144,15 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle, } utf16 += utf16charlen; } + + if(co == length) + { + *actual_x = tx; + co = length; + } + *char_offset = co; - if(co>=length) *actual_x = tx; + free(outf16); return true; -- cgit v1.2.3