diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2010-08-13 19:02:39 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2010-08-13 19:02:39 +0000 |
commit | 3d8a39e2258343891bdffe985673c5e5a1c213e8 (patch) | |
tree | 21e293ad138a9f1916fe484d9882e9be1069d7ea /render | |
parent | ab24d46f768c43e734d64b91f423d2e8b860acd0 (diff) | |
download | netsurf-3d8a39e2258343891bdffe985673c5e5a1c213e8.tar.gz netsurf-3d8a39e2258343891bdffe985673c5e5a1c213e8.tar.bz2 |
Skip transparent borders early and change border side plot order.
svn path=/trunk/netsurf/; revision=10695
Diffstat (limited to 'render')
-rw-r--r-- | render/html_redraw.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index 35333d65a..8a111a975 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -1050,12 +1050,13 @@ bool html_redraw_caret(struct caret *c, colour current_background_color, bool html_redraw_borders(struct box *box, int x_parent, int y_parent, int p_width, int p_height, float scale) { + unsigned int sides[] = { TOP, BOTTOM, LEFT, RIGHT }; int top = box->border[TOP].width; int right = box->border[RIGHT].width; int bottom = box->border[BOTTOM].width; int left = box->border[LEFT].width; int x, y; - unsigned int i; + unsigned int i, side; int p[20]; if (scale != 1.0) { @@ -1079,23 +1080,22 @@ bool html_redraw_borders(struct box *box, int x_parent, int y_parent, p[10] = x + p_width + right; p[11] = y + p_height + bottom; p[12] = x - left; p[13] = y + p_height + bottom; p[14] = x; p[15] = y + p_height; - p[16] = x; p[17] = y; - p[18] = x - left; p[19] = y - top; + p[16] = p[0]; p[17] = p[1]; + p[18] = p[2]; p[19] = p[3]; for (i = 0; i != 4; i++) { + side = sides[i]; /* plot order */ colour col = 0; - if (box->border[i].width == 0) + if (box->border[side].width == 0 || box->border[side].color == + CSS_BORDER_COLOR_TRANSPARENT) continue; - if (box->border[i].color == CSS_BORDER_COLOR_TRANSPARENT) { - col = NS_TRANSPARENT; - } else { - col = nscss_color_to_ns(box->border[i].c); - } + col = nscss_color_to_ns(box->border[side].c); - if (!html_redraw_border_plot(i, p, col, box->border[i].style, - box->border[i].width * scale)) + if (!html_redraw_border_plot(side, p, col, + box->border[side].style, + box->border[side].width * scale)) return false; } |