diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2018-05-23 13:04:19 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2018-05-23 13:04:19 +0100 |
commit | 66493421e65d8cbda3e17fdbe43824387e3d51a7 (patch) | |
tree | d260fb3aa5a0af3de954516e8eaac0d3cb5113b4 /desktop | |
parent | a58d97a41a6192038573da6862571dc72a560458 (diff) | |
download | netsurf-66493421e65d8cbda3e17fdbe43824387e3d51a7.tar.gz netsurf-66493421e65d8cbda3e17fdbe43824387e3d51a7.tar.bz2 |
Plotters: Change stroke width in the plot_style_t to fixed point.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/local_history.c | 6 | ||||
-rw-r--r-- | desktop/plot_style.c | 10 | ||||
-rw-r--r-- | desktop/save_pdf.c | 16 | ||||
-rw-r--r-- | desktop/scrollbar.c | 6 | ||||
-rw-r--r-- | desktop/textarea.c | 6 |
5 files changed, 22 insertions, 22 deletions
diff --git a/desktop/local_history.c b/desktop/local_history.c index dc5bac99a..75da4aff1 100644 --- a/desktop/local_history.c +++ b/desktop/local_history.c @@ -55,7 +55,7 @@ struct local_history_session { */ static plot_style_t pstyle_line = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 2, + .stroke_width = plot_style_int_to_fixed(2), }; @@ -72,7 +72,7 @@ static plot_style_t pstyle_bg = { */ static plot_style_t pstyle_rect = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; @@ -81,7 +81,7 @@ static plot_style_t pstyle_rect = { */ static plot_style_t pstyle_rect_sel = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 3, + .stroke_width = plot_style_int_to_fixed(3), }; diff --git a/desktop/plot_style.c b/desktop/plot_style.c index c3a41398d..05954144a 100644 --- a/desktop/plot_style.c +++ b/desktop/plot_style.c @@ -47,7 +47,7 @@ plot_style_t *plot_style_fill_red = &plot_style_fill_red_static; static const plot_style_t plot_style_content_edge_static = { .stroke_type = PLOT_OP_TYPE_SOLID, .stroke_colour = 0x00ff0000, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; plot_style_t const * const plot_style_content_edge = &plot_style_content_edge_static; @@ -55,7 +55,7 @@ plot_style_t const * const plot_style_content_edge = static const plot_style_t plot_style_padding_edge_static = { .stroke_type = PLOT_OP_TYPE_SOLID, .stroke_colour = 0x000000ff, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; plot_style_t const * const plot_style_padding_edge = &plot_style_padding_edge_static; @@ -63,7 +63,7 @@ plot_style_t const * const plot_style_padding_edge = static const plot_style_t plot_style_margin_edge_static = { .stroke_type = PLOT_OP_TYPE_SOLID, .stroke_colour = 0x0000ffff, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; plot_style_t const * const plot_style_margin_edge = &plot_style_margin_edge_static; @@ -74,7 +74,7 @@ static const plot_style_t plot_style_broken_object_static = { .fill_colour = 0x008888ff, .stroke_type = PLOT_OP_TYPE_SOLID, .stroke_colour = 0x000000ff, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; plot_style_t const * const plot_style_broken_object = &plot_style_broken_object_static; @@ -134,7 +134,7 @@ plot_style_t *plot_style_fill_wblobc = &plot_style_fill_wblobc_static; static plot_style_t plot_style_stroke_wblobc_static = { .stroke_type = PLOT_OP_TYPE_SOLID, .stroke_colour = WIDGET_BLOBC, - .stroke_width = 2, + .stroke_width = plot_style_int_to_fixed(2), }; plot_style_t *plot_style_stroke_wblobc = &plot_style_stroke_wblobc_static; diff --git a/desktop/save_pdf.c b/desktop/save_pdf.c index 83e3d4f31..889190089 100644 --- a/desktop/save_pdf.c +++ b/desktop/save_pdf.c @@ -213,10 +213,10 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty } apply_clip_and_mode(false, - NS_TRANSPARENT, - pstyle->stroke_colour, - pstyle->stroke_width, - dash); + NS_TRANSPARENT, + pstyle->stroke_colour, + plot_style_int_to_fixed(pstyle->stroke_width), + dash); HPDF_Page_Rectangle(pdf_page, x0, page_height - y0, x1 - x0, -(y1 - y0)); HPDF_Page_Stroke(pdf_page); @@ -245,10 +245,10 @@ bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle) } apply_clip_and_mode(false, - NS_TRANSPARENT, - pstyle->stroke_colour, - pstyle->stroke_width, - dash); + NS_TRANSPARENT, + pstyle->stroke_colour, + plot_style_int_to_fixed(pstyle->stroke_width), + dash); HPDF_Page_MoveTo(pdf_page, x0, page_height - y0); HPDF_Page_LineTo(pdf_page, x1, page_height - y1); diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index 5a7420ae1..af5536ba4 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -164,17 +164,17 @@ scrollbar_rectangle(const struct redraw_context *ctx, static plot_style_t c0 = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; static plot_style_t c1 = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; static plot_style_t c2 = { .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_width = 1, + .stroke_width = plot_style_int_to_fixed(1), }; if (inset) { diff --git a/desktop/textarea.c b/desktop/textarea.c index 5666c975b..5bae27a5c 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -45,9 +45,9 @@ #define TA_ALLOC_STEP 512 static plot_style_t pstyle_stroke_caret = { - .stroke_type = PLOT_OP_TYPE_SOLID, - .stroke_colour = CARET_COLOR, - .stroke_width = 1, + .stroke_type = PLOT_OP_TYPE_SOLID, + .stroke_colour = CARET_COLOR, + .stroke_width = plot_style_int_to_fixed(1), }; struct line_info { |