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 --- amiga/plotters.c | 13 +++++++------ amiga/plotters.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'amiga') diff --git a/amiga/plotters.c b/amiga/plotters.c index f89b12c04..9c61ad259 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -400,7 +400,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style) } -bool ami_clip(int x0, int y0, int x1, int y1) +bool ami_clip(const struct rect *clip) { #ifdef AMI_PLOTTER_DEBUG LOG(("[ami_plotter] Entered ami_clip()")); @@ -412,10 +412,10 @@ bool ami_clip(int x0, int y0, int x1, int y1) { reg = NewRegion(); - glob->rect.MinX = x0; - glob->rect.MinY = y0; - glob->rect.MaxX = x1-1; - glob->rect.MaxY = y1-1; + glob->rect.MinX = clip->x0; + glob->rect.MinY = clip->y0; + glob->rect.MaxX = clip->x1-1; + glob->rect.MaxY = clip->y1-1; OrRectRegion(reg,&glob->rect); @@ -426,7 +426,8 @@ bool ami_clip(int x0, int y0, int x1, int y1) #ifdef NS_AMIGA_CAIRO_ALL cairo_reset_clip(glob->cr); - cairo_rectangle(glob->cr, x0, y0, x1 - x0, y1 - y0); + cairo_rectangle(glob->cr, clip->x0, clip->y0, + clip->x1 - clip->x0, clip->y1 - clip->y0); cairo_clip(glob->cr); #endif diff --git a/amiga/plotters.h b/amiga/plotters.h index c58acfb8e..7bd42af6f 100755 --- a/amiga/plotters.h +++ b/amiga/plotters.h @@ -46,7 +46,7 @@ bool ami_clg(colour c); bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style); bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style); bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style); -bool ami_clip(int x0, int y0, int x1, int y1); +bool ami_clip(const struct rect *clip); bool ami_text(int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle); bool ami_disc(int x, int y, int radius, const plot_style_t *style); -- cgit v1.2.3