From 94e7b44ebc1710eed0f870428ddb5bfcd85858fa Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 14 Feb 2011 22:05:39 +0000 Subject: Pass clip rect to clip plotters as struct. Simplify clip rect handling in debug window code. Pass clip rect to select menu as struct. svn path=/trunk/netsurf/; revision=11683 --- riscos/plotters.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'riscos/plotters.c') diff --git a/riscos/plotters.c b/riscos/plotters.c index 1323835d0..8d489fc0f 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -41,8 +41,7 @@ static bool ro_plot_draw_path(const draw_path * const path, int width, static bool ro_plot_polygon(const int *p, unsigned int n, const plot_style_t *style); static bool ro_plot_path(const float *p, unsigned int n, colour fill, float width, colour c, const float transform[6]); -static bool ro_plot_clip(int clip_x0, int clip_y0, - int clip_x1, int clip_y1); +static bool ro_plot_clip(const struct rect *clip); static bool ro_plot_text(int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle); static bool ro_plot_disc(int x, int y, int radius, const plot_style_t *style); @@ -356,16 +355,15 @@ error: -bool ro_plot_clip(int clip_x0, int clip_y0, - int clip_x1, int clip_y1) +bool ro_plot_clip(const struct rect *clip) { os_error *error; char buf[12]; - clip_x0 = ro_plot_origin_x + clip_x0 * 2; - clip_y0 = ro_plot_origin_y - clip_y0 * 2 - 1; - clip_x1 = ro_plot_origin_x + clip_x1 * 2 - 1; - clip_y1 = ro_plot_origin_y - clip_y1 * 2; + int clip_x0 = ro_plot_origin_x + clip->x0 * 2; + int clip_y0 = ro_plot_origin_y - clip->y0 * 2 - 1; + int clip_x1 = ro_plot_origin_x + clip->x1 * 2 - 1; + int clip_y1 = ro_plot_origin_y - clip->y1 * 2; if (clip_x1 < clip_x0 || clip_y0 < clip_y1) { LOG(("bad clip rectangle %i %i %i %i", -- cgit v1.2.3