summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/plot_style.c22
-rw-r--r--desktop/plot_style.h8
-rw-r--r--render/html_redraw.c12
3 files changed, 23 insertions, 19 deletions
diff --git a/desktop/plot_style.c b/desktop/plot_style.c
index 42a4c924f..fa94076e8 100644
--- a/desktop/plot_style.c
+++ b/desktop/plot_style.c
@@ -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 = {
+/* 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 = 0x000000ff,
+ .stroke_colour = 0x00ff0000,
.stroke_width = 1,
};
-plot_style_t *plot_style_stroke_red = &plot_style_stroke_red_static;
+plot_style_t const * const plot_style_content_edge =
+ &plot_style_content_edge_static;
-static plot_style_t plot_style_stroke_blue_static = {
+static const plot_style_t plot_style_padding_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_colour = 0x00ff0000,
+ .stroke_colour = 0x000000ff,
.stroke_width = 1,
};
-plot_style_t *plot_style_stroke_blue = &plot_style_stroke_blue_static;
+plot_style_t const * const plot_style_padding_edge =
+ &plot_style_padding_edge_static;
-static plot_style_t plot_style_stroke_yellow_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 = {
diff --git a/desktop/plot_style.h b/desktop/plot_style.h
index 8c10af0fa..76843fad4 100644
--- a/desktop/plot_style.h
+++ b/desktop/plot_style.h
@@ -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;
diff --git a/render/html_redraw.c b/render/html_redraw.c
index d46375b21..30a7c5ea2 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -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;
}