From 44c5aef1c8a79a3a9afbd472d1f6e6e238c8ed5c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 1 Mar 2017 23:30:29 +0000 Subject: make scrollbar redraw signal errors correctly allow scrollbar redraw to return error codes and update documentation commenst appropriately. --- desktop/browser.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index 3a7ac0ecc..d0114ef9d 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -154,8 +154,11 @@ browser_window_set_name(struct browser_window *bw, const char *name) } /* exported interface, documented in browser.h */ -bool browser_window_redraw(struct browser_window *bw, int x, int y, - const struct rect *clip, const struct redraw_context *ctx) +bool +browser_window_redraw(struct browser_window *bw, + int x, int y, + const struct rect *clip, + const struct redraw_context *ctx) { struct redraw_context new_ctx = *ctx; int width = 0; @@ -164,6 +167,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y, content_type content_type; struct content_redraw_data data; struct rect content_clip; + nserror res; if (bw == NULL) { LOG("NULL browser window"); @@ -299,16 +303,22 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y, if (bw->scroll_x != NULL) { browser_window_get_scrollbar_pos(bw, true, &off_x, &off_y); - plot_ok &= scrollbar_redraw(bw->scroll_x, + res = scrollbar_redraw(bw->scroll_x, x + off_x, y + off_y, clip, bw->scale, &new_ctx); + if (res != NSERROR_OK) { + plot_ok = false; + } } if (bw->scroll_y != NULL) { browser_window_get_scrollbar_pos(bw, false, &off_x, &off_y); - plot_ok &= scrollbar_redraw(bw->scroll_y, + res = scrollbar_redraw(bw->scroll_y, x + off_x, y + off_y, clip, bw->scale, &new_ctx); + if (res != NSERROR_OK) { + plot_ok = false; + } } } -- cgit v1.2.3