From 6265bba6fad216691e05dd46335d955d25326435 Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 19 Jul 2006 22:13:32 +0000 Subject: [PATCH] alternate fix to bug #979 retaining BP;IN; at beginning --- lib/common/emit.c | 2 ++ lib/common/hpglgen.c | 11 +++-------- lib/gvc/gvrender.c | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index b6ded35cd..bbccffc12 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -473,6 +473,8 @@ fprintf(stderr,"zoom = %g dpi = %g,%g\n", #endif gvrender_begin_page(job); + gvrender_set_pencolor(job, DEFAULT_COLOR); + gvrender_set_fillcolor(job, DEFAULT_FILL); } #if 0 diff --git a/lib/common/hpglgen.c b/lib/common/hpglgen.c index 8d00c5ab7..263659242 100644 --- a/lib/common/hpglgen.c +++ b/lib/common/hpglgen.c @@ -402,13 +402,6 @@ hpgl_begin_job(FILE * ofp, graph_t * g, char **lib, char *user, { /* Pages = pages; */ N_pages = pages.x * pages.y; - initGC(); -} - -static void -hpgl_end_job(void) -{ - destroyGC(); } static void hpgl_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb) @@ -452,6 +445,7 @@ static void hpgl_begin_page(graph_t * g, point page, double scale, int rot, #if 0 /* not used */ initTextAlign(); #endif + initGC(); if (N_pages > 1) { saveGC(); @@ -508,6 +502,7 @@ static void hpgl_end_page(void) sprintf(buffer, "PU%sSP0%sPG;\n", Sep, Sep); /* pen up; advance page */ output(buffer); output(suffix); + destroyGC(); } static void hpgl_begin_context(void) @@ -840,7 +835,7 @@ static void hpgl_usershape(usershape_t *us, boxf p, point *A, int n, bool filled codegen_t HPGL_CodeGen = { hpgl_reset, - hpgl_begin_job, hpgl_end_job, + hpgl_begin_job, 0, /* hpgl_end_job */ hpgl_begin_graph, 0, /* hpgl_end_graph */ hpgl_begin_page, hpgl_end_page, 0, /* hpgl_begin_layer */ 0, /* hpgl_end_layer */ diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 584832156..657c2667f 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -426,8 +426,6 @@ void gvrender_begin_graph(GVJ_t * job, graph_t * g) /* init stack */ gvc->SP = 0; job->style = &(gvc->styles[0]); - gvrender_set_pencolor(job, DEFAULT_COLOR); - gvrender_set_fillcolor(job, DEFAULT_FILL); job->style->fontfam = DEFAULT_FONTNAME; job->style->fontsz = DEFAULT_FONTSIZE; job->style->fontopt = FONT_REGULAR; -- 2.40.0