diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-02-11 13:54:08 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-02-11 13:55:41 +0000 |
commit | 3722ff8d867db506c68e5467bbcdb6012e384fc8 (patch) | |
tree | 451e1a614e64b7e7e87c6273856017d3b81b99e5 /render/textplain.c | |
parent | 98ccc9fe1836c59f7eff43f45ac2323798ee785a (diff) | |
download | netsurf-3722ff8d867db506c68e5467bbcdb6012e384fc8.tar.gz netsurf-3722ff8d867db506c68e5467bbcdb6012e384fc8.tar.bz2 |
Update all core use of plotters to new API
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; + } } } |