diff options
author | Adrian Lees <adrian@aemulor.com> | 2006-03-26 05:46:21 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2006-03-26 05:46:21 +0000 |
commit | 05be9c073cc2a59b6989d7c4c0fedc41ee47b45e (patch) | |
tree | b94a0797c6863f2529cbc19fa3516070409ceeaa | |
parent | a80b268ad9ccb13089625864f3b7748d2a8b50a0 (diff) | |
download | netsurf-05be9c073cc2a59b6989d7c4c0fedc41ee47b45e.tar.gz netsurf-05be9c073cc2a59b6989d7c4c0fedc41ee47b45e.tar.bz2 |
[project @ 2006-03-26 05:46:21 by adrianl]
Correct usage of utf8_next
svn path=/import/netsurf/; revision=2172
-rw-r--r-- | render/textplain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/render/textplain.c b/render/textplain.c index 6e31b2b44..d2c3db956 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -475,12 +475,12 @@ size_t textplain_offset_from_coords(struct content *c, int x, int y, int dir) int width = INT_MAX; while (next_offset < length && text[next_offset] != '\t') - next_offset = utf8_next(text, next_offset, length); + next_offset = utf8_next(text, length, next_offset); if (next_offset < length) nsfont_width(&textplain_style, text, next_offset, &width); - if (x < width) { + if (x <= width) { int pixel_offset; int char_offset; @@ -499,7 +499,7 @@ size_t textplain_offset_from_coords(struct content *c, int x, int y, int dir) /* check if it's within the tab */ width = textplain_tab_width - (width % textplain_tab_width); - if (x < width) break; + if (x <= width) break; x -= width; length--; |