summaryrefslogtreecommitdiff
path: root/render/html_redraw.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-07-14 11:45:29 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-07-14 11:45:29 +0000
commit336b21198dd9ef58ad208e5232781bf9f04b29ab (patch)
tree6add47d186fdf03599ee942599fa7ecc4045a5c4 /render/html_redraw.c
parent08fc83b18995381191b0cd5e48efb03b8b75f154 (diff)
downloadnetsurf-336b21198dd9ef58ad208e5232781bf9f04b29ab.tar.gz
netsurf-336b21198dd9ef58ad208e5232781bf9f04b29ab.tar.bz2
Plot debug outlines after borders and backgrounds, so that they can be seen when things are coloured. Plot content edge before padding edge, so that the colour for the outermost edge is always shown when margin, border or padding are 0.
svn path=/trunk/netsurf/; revision=8515
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r--render/html_redraw.c77
1 files changed, 40 insertions, 37 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index c57c0193f..d46375b21 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -309,43 +309,6 @@ bool html_redraw_box(struct box *box,
if ((plot.group_start) && (!plot.group_start("vis box")))
return false;
- /* dotted debug outlines */
- if (html_redraw_debug) {
- int margin_left, margin_right;
- int margin_top, margin_bottom;
- if (scale == 1.0) {
- /* avoid trivial fp maths */
- margin_left = box->margin[LEFT];
- margin_top = box->margin[TOP];
- margin_right = box->margin[RIGHT];
- margin_bottom = box->margin[BOTTOM];
- } else {
- margin_left = box->margin[LEFT] * scale;
- margin_top = box->margin[TOP] * scale;
- margin_right = box->margin[RIGHT] * scale;
- margin_bottom = box->margin[BOTTOM] * scale;
- }
- if (!plot.rectangle(x, y,
- x + padding_width, y + padding_height,
- plot_style_stroke_red))
- return false;
- if (!plot.rectangle(x + padding_left,
- y + padding_top,
- x + padding_left + width,
- y + padding_top + height,
- plot_style_stroke_blue))
- return false;
- if (!plot.rectangle(
- x - border_left - margin_left,
- y - border_top - margin_top,
- x + padding_width + border_right +
- margin_right,
- y + padding_height + border_bottom +
- margin_bottom,
- plot_style_stroke_yellow))
- return false;
- }
-
if (box->type == BOX_BLOCK || box->type == BOX_INLINE_BLOCK ||
box->type == BOX_TABLE_CELL || box->object) {
/* find intersection of clip rectangle and box */
@@ -583,6 +546,46 @@ bool html_redraw_box(struct box *box,
}
+ /* dotted debug outlines */
+ if (html_redraw_debug) {
+ int margin_left, margin_right;
+ int margin_top, margin_bottom;
+ if (scale == 1.0) {
+ /* avoid trivial fp maths */
+ margin_left = box->margin[LEFT];
+ margin_top = box->margin[TOP];
+ margin_right = box->margin[RIGHT];
+ margin_bottom = box->margin[BOTTOM];
+ } else {
+ margin_left = box->margin[LEFT] * scale;
+ margin_top = box->margin[TOP] * scale;
+ margin_right = box->margin[RIGHT] * scale;
+ margin_bottom = box->margin[BOTTOM] * scale;
+ }
+ /* Content edge */
+ if (!plot.rectangle(x + padding_left,
+ y + padding_top,
+ x + padding_left + width,
+ y + padding_top + height,
+ plot_style_stroke_blue))
+ return false;
+ /* Padding edge */
+ if (!plot.rectangle(x, y,
+ x + padding_width, y + padding_height,
+ plot_style_stroke_red))
+ return false;
+ /* Margin edge */
+ if (!plot.rectangle(
+ x - border_left - margin_left,
+ y - border_top - margin_top,
+ x + padding_width + border_right +
+ margin_right,
+ y + padding_height + border_bottom +
+ margin_bottom,
+ plot_style_stroke_yellow))
+ return false;
+ }
+
/* clip to the padding edge for boxes with overflow hidden or scroll */
if (box->style && box->style->overflow != CSS_OVERFLOW_VISIBLE) {
x0 = x;