From 5c0eca30a3cd711d87bd640af1422c074aeede48 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 29 Aug 2018 21:10:51 +0100 Subject: fix plot style float to fix path width --- content/handlers/pdf/pdf.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'content') diff --git a/content/handlers/pdf/pdf.c b/content/handlers/pdf/pdf.c index 89548cd46..ec283aa3a 100644 --- a/content/handlers/pdf/pdf.c +++ b/content/handlers/pdf/pdf.c @@ -1,6 +1,5 @@ /* - * Copyright 2004 James Bursa - * Copyright 2004 John M Bell + * Copyright 2018 Vincent Sanders * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -154,7 +153,7 @@ static bool pdf_convert(struct content *c) } /** \todo extract documents starting page number */ - pdfc->current_page = 16; + pdfc->current_page = 0; pdfres = nspdf_get_page_dimensions(pdfc->doc, pdfc->current_page, @@ -180,12 +179,16 @@ pdf_path(const struct nspdf_style *style, { const struct redraw_context *ctx = ctxin; - ctx->plot->path(ctx, - (const struct plot_style_s *)style, - path, - path_length, - style->stroke_width, - transform); + struct plot_style_s nsstyle; + + nsstyle.stroke_type = style->stroke_type; + nsstyle.stroke_width = plot_style_float_to_fixed(style->stroke_width); + nsstyle.stroke_colour = style->stroke_colour; + nsstyle.fill_type = style->fill_type; + nsstyle.fill_colour = style->fill_colour; + + ctx->plot->path(ctx, &nsstyle, path, path_length, transform); + return NSPDFERROR_OK; } -- cgit v1.2.3