summaryrefslogtreecommitdiff
path: root/desktop/save_pdf
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-07-10 18:36:49 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-07-10 18:36:49 +0000
commit680298e61ce664e95b3f8143c0c0b814d5966f2a (patch)
treecd4bdf673143a3ff8496498927de526adfb9804e /desktop/save_pdf
parent5feb7018c5228a22d370d070c1f7c3dad2c71e25 (diff)
downloadnetsurf-680298e61ce664e95b3f8143c0c0b814d5966f2a.tar.gz
netsurf-680298e61ce664e95b3f8143c0c0b814d5966f2a.tar.bz2
plotters line refactor
svn path=/trunk/netsurf/; revision=8446
Diffstat (limited to 'desktop/save_pdf')
-rw-r--r--desktop/save_pdf/pdf_plotters.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/desktop/save_pdf/pdf_plotters.c b/desktop/save_pdf/pdf_plotters.c
index 468c19ed1..58df607d6 100644
--- a/desktop/save_pdf/pdf_plotters.c
+++ b/desktop/save_pdf/pdf_plotters.c
@@ -46,8 +46,7 @@
/* #define PDF_DEBUG_DUMPGRID */
static bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style);
-static bool pdf_plot_line(int x0, int y0, int x1, int y1, int width,
- colour c, bool dotted, bool dashed);
+static bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle);
static bool pdf_plot_polygon(const int *p, unsigned int n, colour fill);
static bool pdf_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
@@ -200,16 +199,30 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty
return true;
}
-bool pdf_plot_line(int x0, int y0, int x1, int y1, int width,
- colour c, bool dotted, bool dashed)
+bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle)
{
-#ifdef PDF_DEBUG
- LOG(("."));
-#endif
+ DashPattern_e dash;
+
+ switch (pstyle->stroke_type) {
+ case PLOT_OP_TYPE_DOT:
+ dash = DashPattern_eDotted;
+ break;
+
+ case PLOT_OP_TYPE_DASH:
+ dash = DashPattern_eDash;
+ break;
+
+ default:
+ dash = DashPattern_eNone;
+ break;
+
+ }
- apply_clip_and_mode(false, TRANSPARENT, c, width,
- (dotted) ? DashPattern_eDotted :
- ((dashed) ? DashPattern_eDash : DashPattern_eNone));
+ apply_clip_and_mode(false,
+ TRANSPARENT,
+ pstyle->stroke_colour,
+ pstyle->stroke_width,
+ dash);
HPDF_Page_MoveTo(pdf_page, x0, page_height - y0);
HPDF_Page_LineTo(pdf_page, x1, page_height - y1);