diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-02-12 20:01:05 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-02-12 20:01:05 +0000 |
commit | 1666944c7e5c7a300ad0658b9654464ff2c11495 (patch) | |
tree | 8b40a9c13e28cc67135cb75ded1f3477390039cc /render/textplain.c | |
parent | 703fd10400f83bd136acf46162fe109f87d5e538 (diff) | |
parent | 513366a7a22dfeafc6a79814701ba62210ad5040 (diff) | |
download | netsurf-1666944c7e5c7a300ad0658b9654464ff2c11495.tar.gz netsurf-1666944c7e5c7a300ad0658b9654464ff2c11495.tar.bz2 |
Merge branch 'vince/plotctx'
Diffstat (limited to 'render/textplain.c')
-rw-r--r-- | render/textplain.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/render/textplain.c b/render/textplain.c index ae148697e..d3768889d 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -865,7 +865,6 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, { textplain_content *text = (textplain_content *) c; struct browser_window *bw = text->bw; - const struct plotter_table *plot = ctx->plot; char *utf8_data = text->utf8_data; long lineno; int x = data->x; @@ -878,6 +877,7 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, struct textplain_line *line = text->physical_line; size_t length; plot_style_t *plot_style_highlight; + nserror res; if (line0 < 0) line0 = 0; @@ -890,9 +890,10 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, if (line1 < line0) line1 = line0; - if (!plot->rectangle(clip->x0, clip->y0, clip->x1, clip->y1, - plot_style_fill_white)) + res = ctx->plot->rectangle(ctx, plot_style_fill_white, clip); + if (res != NSERROR_OK) { return false; + } if (!line) return true; @@ -979,11 +980,17 @@ bool textplain_redraw(struct content *c, struct content_redraw_data *data, } if (highlighted) { - int sy = y + (lineno * scaled_line_height); - if (!plot->rectangle(tx, sy, - ntx, sy + scaled_line_height, - plot_style_highlight)) + struct rect rect; + rect.x0 = tx; + rect.y0 = y + (lineno * scaled_line_height); + rect.x1 = ntx; + rect.y1 = rect.y0 + scaled_line_height; + res = ctx->plot->rectangle(ctx, + plot_style_highlight, + &rect); + if (res != NSERROR_OK) { return false; + } } } |