mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
Rename debug outline plot styles and make them const.
svn path=/trunk/netsurf/; revision=8518
This commit is contained in:
parent
336b21198d
commit
2d95b8aa57
@ -18,7 +18,7 @@
|
||||
|
||||
/** \file Plotter global styles.
|
||||
*
|
||||
* These plot styles are globaly available and used in many places.
|
||||
* These plot styles are globaly available and used in many places.
|
||||
*/
|
||||
|
||||
#include "desktop/plotters.h"
|
||||
@ -41,26 +41,30 @@ static plot_style_t plot_style_fill_red_static = {
|
||||
};
|
||||
plot_style_t *plot_style_fill_red = &plot_style_fill_red_static;
|
||||
|
||||
static plot_style_t plot_style_stroke_red_static = {
|
||||
.stroke_type = PLOT_OP_TYPE_SOLID,
|
||||
.stroke_colour = 0x000000ff,
|
||||
.stroke_width = 1,
|
||||
};
|
||||
plot_style_t *plot_style_stroke_red = &plot_style_stroke_red_static;
|
||||
|
||||
static plot_style_t plot_style_stroke_blue_static = {
|
||||
/* Box model debug outline styles for content, padding and margin edges */
|
||||
static const plot_style_t plot_style_content_edge_static = {
|
||||
.stroke_type = PLOT_OP_TYPE_SOLID,
|
||||
.stroke_colour = 0x00ff0000,
|
||||
.stroke_width = 1,
|
||||
};
|
||||
plot_style_t *plot_style_stroke_blue = &plot_style_stroke_blue_static;
|
||||
plot_style_t const * const plot_style_content_edge =
|
||||
&plot_style_content_edge_static;
|
||||
|
||||
static plot_style_t plot_style_stroke_yellow_static = {
|
||||
static const plot_style_t plot_style_padding_edge_static = {
|
||||
.stroke_type = PLOT_OP_TYPE_SOLID,
|
||||
.stroke_colour = 0x000000ff,
|
||||
.stroke_width = 1,
|
||||
};
|
||||
plot_style_t const * const plot_style_padding_edge =
|
||||
&plot_style_padding_edge_static;
|
||||
|
||||
static const plot_style_t plot_style_margin_edge_static = {
|
||||
.stroke_type = PLOT_OP_TYPE_SOLID,
|
||||
.stroke_colour = 0x0000ffff,
|
||||
.stroke_width = 1,
|
||||
};
|
||||
plot_style_t *plot_style_stroke_yellow = &plot_style_stroke_yellow_static;
|
||||
plot_style_t const * const plot_style_margin_edge =
|
||||
&plot_style_margin_edge_static;
|
||||
|
||||
/* caret style used in html_redraw_caret */
|
||||
static plot_style_t plot_style_caret_static = {
|
||||
|
@ -82,10 +82,10 @@ extern plot_style_t *plot_style_fill_white;
|
||||
extern plot_style_t *plot_style_fill_red;
|
||||
extern plot_style_t *plot_style_fill_black;
|
||||
|
||||
/* global stroke styles */
|
||||
extern plot_style_t *plot_style_stroke_red;
|
||||
extern plot_style_t *plot_style_stroke_blue;
|
||||
extern plot_style_t *plot_style_stroke_yellow;
|
||||
/* Box model debug outline styles for content, padding and margin edges */
|
||||
extern plot_style_t const * const plot_style_content_edge;
|
||||
extern plot_style_t const * const plot_style_padding_edge;
|
||||
extern plot_style_t const * const plot_style_margin_edge;
|
||||
|
||||
/* other styles */
|
||||
extern plot_style_t *plot_style_caret;
|
||||
|
@ -562,19 +562,19 @@ bool html_redraw_box(struct box *box,
|
||||
margin_right = box->margin[RIGHT] * scale;
|
||||
margin_bottom = box->margin[BOTTOM] * scale;
|
||||
}
|
||||
/* Content edge */
|
||||
/* Content edge -- blue */
|
||||
if (!plot.rectangle(x + padding_left,
|
||||
y + padding_top,
|
||||
x + padding_left + width,
|
||||
y + padding_top + height,
|
||||
plot_style_stroke_blue))
|
||||
plot_style_content_edge))
|
||||
return false;
|
||||
/* Padding edge */
|
||||
/* Padding edge -- red */
|
||||
if (!plot.rectangle(x, y,
|
||||
x + padding_width, y + padding_height,
|
||||
plot_style_stroke_red))
|
||||
plot_style_padding_edge))
|
||||
return false;
|
||||
/* Margin edge */
|
||||
/* Margin edge -- yellow */
|
||||
if (!plot.rectangle(
|
||||
x - border_left - margin_left,
|
||||
y - border_top - margin_top,
|
||||
@ -582,7 +582,7 @@ bool html_redraw_box(struct box *box,
|
||||
margin_right,
|
||||
y + padding_height + border_bottom +
|
||||
margin_bottom,
|
||||
plot_style_stroke_yellow))
|
||||
plot_style_margin_edge))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user