From fe7921a387c5a71c8ecba7bb605679b7dab4b86f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 13 Feb 2011 22:25:11 +0000 Subject: Pass clip rect as struct through content_redraw api. Update the front ends to use this. Note only RO build tested. svn path=/trunk/netsurf/; revision=11670 --- desktop/browser.c | 3 +-- desktop/print.c | 26 +++++++++++--------------- desktop/tree.c | 2 +- 3 files changed, 13 insertions(+), 18 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 454fbf5e9..3d5f1a9cb 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -120,8 +120,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y, } return content_redraw(bw->current_content, x, y, width, height, - clip.x0, clip.y0, clip.x1, clip.y1, - bw->scale, 0xFFFFFF); + &clip, bw->scale, 0xFFFFFF); } /* exported interface, documented in browser.h */ diff --git a/desktop/print.c b/desktop/print.c index 0099a8c69..995f1bf73 100644 --- a/desktop/print.c +++ b/desktop/print.c @@ -120,32 +120,28 @@ bool print_set_up(hlcache_handle *content, bool print_draw_next_page(const struct printer *printer, struct print_settings *settings) { - int clip_x1, clip_y1; + struct rect clip; plot = *(printer->plotter); html_redraw_printing_top_cropped = INT_MAX; - - clip_x1 = page_content_width * settings->scale; - clip_y1 = page_content_height * settings->scale; + + clip.x0 = 0; + clip.y0 = 0; + clip.x1 = page_content_width * settings->scale; + clip.y1 = page_content_height * settings->scale; html_redraw_printing = true; - html_redraw_printing_border = clip_y1; + html_redraw_printing_border = clip.y1; printer->print_next_page(); - if (!content_redraw(printed_content, - 0, - -done_height, - 0,0, - 0, - 0, - clip_x1, - clip_y1, - settings->scale, 0xffffff)) + if (!content_redraw(printed_content, 0, -done_height, + 0, 0, + &clip, settings->scale, 0xffffff)) return false; done_height += page_content_height - (html_redraw_printing_top_cropped != INT_MAX ? - clip_y1 - html_redraw_printing_top_cropped : 0) / + clip.y1 - html_redraw_printing_top_cropped : 0) / settings->scale; return true; diff --git a/desktop/tree.c b/desktop/tree.c index ddffef698..131106b65 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -1623,7 +1623,7 @@ static void tree_draw_node_element(struct tree *tree, plot.clip(c.x0, c.y0, c.x1, c.y1); content_redraw(icon , x, y + icon_inset, TREE_ICON_SIZE, TREE_ICON_SIZE, - c.x0, c.y0, c.x1, c.y1, 1, 0); + &c, 1, 0); /* Restore previous clipping area */ plot.clip(clip.x0, clip.y0, clip.x1, clip.y1); -- cgit v1.2.3