From d6b6dafe50807138da5ad340157042318bc36615 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 Apr 2016 10:50:13 +0100 Subject: fix plain text render regression introduced in layout table changes --- render/textplain.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'render') diff --git a/render/textplain.c b/render/textplain.c index e999c352e..c825b7946 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -924,6 +924,7 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, size_t next_offset = offset; int width; int ntx; + nserror res; while (next_offset < length && text_d[next_offset] != '\t') next_offset = utf8_next(text_d, length, next_offset); @@ -940,11 +941,12 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, if (next_offset >= length) break; - /* locate end of string and align to next tab position */ - if (guit->layout->width(&textplain_style, + res = guit->layout->width(&textplain_style, &text_d[offset], next_offset - offset, - &width)) { + &width); + /* locate end of string and align to next tab position */ + if (res == NSERROR_OK) { tx += (int)(width * data->scale); } -- cgit v1.2.3