diff options
author | François Revel <mmu_man@netsurf-browser.org> | 2008-12-21 21:28:12 +0000 |
---|---|---|
committer | François Revel <mmu_man@netsurf-browser.org> | 2008-12-21 21:28:12 +0000 |
commit | fe355fc08752b39da40fa41eb7be9b4d45f8533f (patch) | |
tree | 878ef6142cef395c32880c415d0423192b463904 /render/html_redraw.c | |
parent | 6a4d4489f55f24ed0e446bac1e661a78513cc0a6 (diff) | |
download | netsurf-fe355fc08752b39da40fa41eb7be9b4d45f8533f.tar.gz netsurf-fe355fc08752b39da40fa41eb7be9b4d45f8533f.tar.bz2 |
C89
svn path=/trunk/netsurf/; revision=5919
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r-- | render/html_redraw.c | 123 |
1 files changed, 64 insertions, 59 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index 00db5781b..467f09bd4 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -911,6 +911,8 @@ bool html_redraw_borders(struct box *box, int x_parent, int y_parent, int right = box->border[RIGHT]; int bottom = box->border[BOTTOM]; int left = box->border[LEFT]; + int x, y; + unsigned int i; if (scale != 1.0) { top *= scale; @@ -921,32 +923,33 @@ bool html_redraw_borders(struct box *box, int x_parent, int y_parent, assert(box->style); - int x = (x_parent + box->x) * scale; - int y = (y_parent + box->y) * scale; - - /* calculate border vertices */ - int p[20] = { - x, y, - x - left, y - top, - x + padding_width + right, y - top, - x + padding_width, y, - x + padding_width, y + padding_height, - x + padding_width + right, y + padding_height + bottom, - x - left, y + padding_height + bottom, - x, y + padding_height, - x, y, - x - left, y - top - }; + x = (x_parent + box->x) * scale; + y = (y_parent + box->y) * scale; - unsigned int i; - for (i = 0; i != 4; i++) { - if (box->border[i] == 0) - continue; - if (!html_redraw_border_plot(i, p, - box->style->border[i].color, - box->style->border[i].style, - box->border[i] * scale)) - return false; + { + /* calculate border vertices */ + int p[20] = { + x, y, + x - left, y - top, + x + padding_width + right, y - top, + x + padding_width, y, + x + padding_width, y + padding_height, + x + padding_width + right, y + padding_height + bottom, + x - left, y + padding_height + bottom, + x, y + padding_height, + x, y, + x - left, y - top + }; + + for (i = 0; i != 4; i++) { + if (box->border[i] == 0) + continue; + if (!html_redraw_border_plot(i, p, + box->style->border[i].color, + box->style->border[i].style, + box->border[i] * scale)) + return false; + } } return true; @@ -984,40 +987,42 @@ bool html_redraw_inline_borders(struct box *box, int x0, int y0, int x1, int y1, assert(box->style); - /* calculate border vertices */ - int p[20] = { - x0 + left, y0 + top, - x0, y0, - x1, y0, - x1 - right, y0 + top, - x1 - right, y1 - bottom, - x1, y1, - x0, y1, - x0 + left, y1 - bottom, - x0 + left, y0 + top, - x0, y0 - }; - - if (box->border[LEFT] && first) - if (!html_redraw_border_plot(LEFT, p, - box->style->border[LEFT].color, - box->style->border[LEFT].style, left)) - return false; - if (box->border[TOP]) - if (!html_redraw_border_plot(TOP, p, - box->style->border[TOP].color, - box->style->border[TOP].style, top)) - return false; - if (box->border[BOTTOM]) - if (!html_redraw_border_plot(BOTTOM, p, - box->style->border[BOTTOM].color, - box->style->border[BOTTOM].style, bottom)) - return false; - if (box->border[RIGHT] && last) - if (!html_redraw_border_plot(RIGHT, p, - box->style->border[RIGHT].color, - box->style->border[RIGHT].style, right)) - return false; + { + /* calculate border vertices */ + int p[20] = { + x0 + left, y0 + top, + x0, y0, + x1, y0, + x1 - right, y0 + top, + x1 - right, y1 - bottom, + x1, y1, + x0, y1, + x0 + left, y1 - bottom, + x0 + left, y0 + top, + x0, y0 + }; + + if (box->border[LEFT] && first) + if (!html_redraw_border_plot(LEFT, p, + box->style->border[LEFT].color, + box->style->border[LEFT].style, left)) + return false; + if (box->border[TOP]) + if (!html_redraw_border_plot(TOP, p, + box->style->border[TOP].color, + box->style->border[TOP].style, top)) + return false; + if (box->border[BOTTOM]) + if (!html_redraw_border_plot(BOTTOM, p, + box->style->border[BOTTOM].color, + box->style->border[BOTTOM].style, bottom)) + return false; + if (box->border[RIGHT] && last) + if (!html_redraw_border_plot(RIGHT, p, + box->style->border[RIGHT].color, + box->style->border[RIGHT].style, right)) + return false; + } return true; } |