diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/font_haru.c | 2 | ||||
-rw-r--r-- | desktop/knockout.c | 4 | ||||
-rw-r--r-- | desktop/local_history.c | 10 | ||||
-rw-r--r-- | desktop/plot_style.c | 14 | ||||
-rw-r--r-- | desktop/save_pdf.c | 16 | ||||
-rw-r--r-- | desktop/scrollbar.c | 6 | ||||
-rw-r--r-- | desktop/textarea.c | 10 | ||||
-rw-r--r-- | desktop/treeview.c | 2 |
8 files changed, 31 insertions, 33 deletions
diff --git a/desktop/font_haru.c b/desktop/font_haru.c index f92d89197..4ee9824f0 100644 --- a/desktop/font_haru.c +++ b/desktop/font_haru.c @@ -352,7 +352,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle, if (size <= 0) return true; - size /= FONT_SIZE_SCALE; + size /= PLOT_STYLE_SCALE; if (size > HPDF_MAX_FONTSIZE) size = HPDF_MAX_FONTSIZE; diff --git a/desktop/knockout.c b/desktop/knockout.c index 6dbf4ebcf..127a48cdb 100644 --- a/desktop/knockout.c +++ b/desktop/knockout.c @@ -671,7 +671,6 @@ knockout_plot_polygon(const struct redraw_context *ctx, * \param pstyle Style controlling the path plot. * \param p elements of path * \param n nunber of elements on path - * \param width The width of the path * \param transform A transform to apply to the path. * \return NSERROR_OK on success else error code. */ @@ -680,14 +679,13 @@ knockout_plot_path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, - float width, const float transform[6]) { nserror res; nserror ffres; ffres = knockout_plot_flush(ctx); - res = real_plot.path(ctx, pstyle, p, n, width, transform); + res = real_plot.path(ctx, pstyle, p, n, transform); /* return the first error */ if ((res != NSERROR_OK) && (ffres == NSERROR_OK)) { diff --git a/desktop/local_history.c b/desktop/local_history.c index 3219de90c..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), }; @@ -90,7 +90,7 @@ static plot_style_t pstyle_rect_sel = { */ static plot_font_style_t pfstyle_node = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 8 * FONT_SIZE_SCALE, + .size = 8 * PLOT_STYLE_SCALE, .weight = 400, .flags = FONTF_NONE, }; @@ -101,7 +101,7 @@ static plot_font_style_t pfstyle_node = { */ static plot_font_style_t pfstyle_node_sel = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 8 * FONT_SIZE_SCALE, + .size = 8 * PLOT_STYLE_SCALE, .weight = 900, .flags = FONTF_NONE, }; diff --git a/desktop/plot_style.c b/desktop/plot_style.c index 1f0ac39cf..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,14 +74,14 @@ 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; static const plot_font_style_t plot_fstyle_broken_object_static = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 16 * FONT_SIZE_SCALE, + .size = 16 * PLOT_STYLE_SCALE, .weight = 400, .flags = FONTF_NONE, .background = 0x8888ff, @@ -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; @@ -156,7 +156,7 @@ plot_style_t *plot_style_stroke_lightwbasec = &plot_style_stroke_lightwbasec_sta /* Generic font style */ static const plot_font_style_t plot_style_font_static = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 8 * FONT_SIZE_SCALE, + .size = 8 * PLOT_STYLE_SCALE, .weight = 400, .flags = FONTF_NONE, .background = 0xffffff, 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 3fd4c9804..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 { @@ -1805,7 +1805,7 @@ static void textarea_setup_text_offsets(struct textarea *ta) ta->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL( nscss_screen_dpi, FDIV(INTTOFIX(ta->fstyle.size), - INTTOFIX(FONT_SIZE_SCALE))), F_72))); + INTTOFIX(PLOT_STYLE_SCALE))), F_72))); text_y_offset = text_y_offset_baseline = ta->border_width; if (ta->flags & TEXTAREA_MULTILINE) { @@ -1948,7 +1948,7 @@ struct textarea *textarea_create(const textarea_flags flags, ret->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL( nscss_screen_dpi, FDIV(INTTOFIX(setup->text.size), - INTTOFIX(FONT_SIZE_SCALE))), F_72))); + INTTOFIX(PLOT_STYLE_SCALE))), F_72))); ret->caret_pos.line = ret->caret_pos.byte_off = -1; ret->caret_x = 0; diff --git a/desktop/treeview.c b/desktop/treeview.c index 1651ff5ef..928a69666 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -5195,7 +5195,7 @@ nserror treeview_init(void) 10 + 36) / 72; tree_g.line_height = (font_px_size * 8 + 3) / 6; - res = treeview_init_plot_styles(font_pt_size * FONT_SIZE_SCALE / 10); + res = treeview_init_plot_styles(font_pt_size * PLOT_STYLE_SCALE / 10); if (res != NSERROR_OK) { return res; } |