summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-05 14:39:38 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-05 14:39:38 +0000
commit3d971835db366f97212d62b8944acfdfbfd357ef (patch)
treec2952c2c63b0f3d433d88a17179c5a235a17f16c
parent2fc90e362cb8526da36f799284df6ed042d7dd58 (diff)
downloadnetsurf-3d971835db366f97212d62b8944acfdfbfd357ef.tar.gz
netsurf-3d971835db366f97212d62b8944acfdfbfd357ef.tar.bz2
Click position improvements
svn path=/trunk/netsurf/; revision=9541
-rw-r--r--amiga/font.c17
1 files changed, 12 insertions, 5 deletions
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(x<tx+glyph->glm_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;