From a7dbc01677a49e9c320053f4984831beca50d046 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 21 Apr 2004 22:26:54 +0000 Subject: [project @ 2004-04-21 22:26:54 by bursa] Fix background clipping bug. svn path=/import/netsurf/; revision=798 --- riscos/htmlredraw.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'riscos') diff --git a/riscos/htmlredraw.c b/riscos/htmlredraw.c index 0beb11dcb..363025609 100644 --- a/riscos/htmlredraw.c +++ b/riscos/htmlredraw.c @@ -204,15 +204,16 @@ void html_redraw_box(struct content *content, struct box * box, /* background colour */ if (box->style != 0 && box->style->background_color != TRANSPARENT) { + /* find intersection of clip box and padding box */ + int px0 = x < x0 ? x0 : x; + int py0 = y - padding_height < y0 ? y0 : y - padding_height; + int px1 = x + padding_width < x1 ? x + padding_width : x1; + int py1 = y < y1 ? y : y1; colourtrans_set_gcol(box->style->background_color << 8, colourtrans_USE_ECFS, os_ACTION_OVERWRITE, 0); - os_plot(os_MOVE_TO, - x < x0 ? x0 : x, - y < y1 ? y : y1); - os_plot(os_PLOT_RECTANGLE | os_PLOT_TO, - x + padding_width < x1 ? x + padding_width : x1, - y - padding_height < y0 ? y0 : - y - padding_height); + os_plot(os_MOVE_TO, px0, py0); + if (px0 < px1 && py0 < py1) + os_plot(os_PLOT_RECTANGLE | os_PLOT_TO, px1, py1); current_background_color = box->style->background_color; } -- cgit v1.2.3