summaryrefslogtreecommitdiff
path: root/riscos/htmlredraw.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-04-21 22:26:54 +0000
committerJames Bursa <james@netsurf-browser.org>2004-04-21 22:26:54 +0000
commita7dbc01677a49e9c320053f4984831beca50d046 (patch)
treee334c78af16b4695564e433780f08edf366f521b /riscos/htmlredraw.c
parentba507a86197744ce343941c72da6c975e4a771ae (diff)
downloadnetsurf-a7dbc01677a49e9c320053f4984831beca50d046.tar.gz
netsurf-a7dbc01677a49e9c320053f4984831beca50d046.tar.bz2
[project @ 2004-04-21 22:26:54 by bursa]
Fix background clipping bug. svn path=/import/netsurf/; revision=798
Diffstat (limited to 'riscos/htmlredraw.c')
-rw-r--r--riscos/htmlredraw.c15
1 files changed, 8 insertions, 7 deletions
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;
}