]> granicus.if.org Git - graphviz/commitdiff
alternate fix to bug #979 retaining BP;IN; at beginning
authorellson <devnull@localhost>
Wed, 19 Jul 2006 22:13:32 +0000 (22:13 +0000)
committerellson <devnull@localhost>
Wed, 19 Jul 2006 22:13:32 +0000 (22:13 +0000)
lib/common/emit.c
lib/common/hpglgen.c
lib/gvc/gvrender.c

index b6ded35cd2410ca5e7e05d40e0bd5147a2cf49c9..bbccffc12790f5fc522ba27a311ceae9e88f9195 100644 (file)
@@ -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
index 8d00c5ab7feba7f98b0c346e9e2f2bbab2ec803d..2636592427d0a2d54af541e1978b062b6bd710ee 100644 (file)
@@ -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 */
index 5848321562742ea0738c1947b8abb18dd0104510..657c2667fb952462490e296c3f42b63c2ea2f9a1 100644 (file)
@@ -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;