From 05be9c073cc2a59b6989d7c4c0fedc41ee47b45e Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sun, 26 Mar 2006 05:46:21 +0000 Subject: [project @ 2006-03-26 05:46:21 by adrianl] Correct usage of utf8_next svn path=/import/netsurf/; revision=2172 --- render/textplain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'render/textplain.c') 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--; -- cgit v1.2.3