From f63322eefea16ab0786a73806cbc03b5613bef53 Mon Sep 17 00:00:00 2001
From: ellson <devnull@localhost>
Date: Thu, 15 Jun 2006 00:01:39 +0000
Subject: [PATCH] fix ps dashing

---
 lib/common/ps.h                | 6 ++++++
 lib/common/ps.txt              | 6 ++++++
 lib/common/psgen.c             | 2 +-
 plugin/core/gvrender_core_ps.c | 2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/common/ps.h b/lib/common/ps.h
index dc1db3a40..c0165bd5d 100644
--- a/lib/common/ps.h
+++ b/lib/common/ps.h
@@ -39,6 +39,12 @@ char *ps_txt[] = {
 "/default-font-family /Times-Roman def",
 "/coordfont coord-font-family findfont 8 scalefont def",
 "",
+"/InvScaleFactor 1.0 def",
+"/set_scale {",
+"       exch dup 1 exch div /InvScaleFactor exch def",
+"       exch scale",
+"} bind def",
+"",
 "% styles",
 "/solid { [] 0 setdash } bind def",
 "/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def",
diff --git a/lib/common/ps.txt b/lib/common/ps.txt
index 168c3852d..755e05132 100644
--- a/lib/common/ps.txt
+++ b/lib/common/ps.txt
@@ -38,6 +38,12 @@ cleartomark
 /default-font-family /Times-Roman def
 /coordfont coord-font-family findfont 8 scalefont def
 
+/InvScaleFactor 1.0 def
+/set_scale {
+       exch dup 1 exch div /InvScaleFactor exch def
+       exch scale
+} bind def
+
 % styles
 /solid { [] 0 setdash } bind def
 /dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
diff --git a/lib/common/psgen.c b/lib/common/psgen.c
index dd25e254c..55c1b9c3f 100644
--- a/lib/common/psgen.c
+++ b/lib/common/psgen.c
@@ -192,7 +192,7 @@ ps_begin_page(graph_t * g, point page, double scale, int rot, point offset)
     fprintf(Output_file, "%d %d %d beginpage\n", page.x, page.y, N_pages);
     if (rot)
         fprintf(Output_file, "grestore\n");
-    fprintf(Output_file, "%g %g scale\n", scale, scale);
+    fprintf(Output_file, "%g %g set_scale\n", scale, scale);
     fprintf(Output_file, "%d %d translate %d rotate\n",
 	    offset.x, offset.y, rot);
     assert(SP == 0);
diff --git a/plugin/core/gvrender_core_ps.c b/plugin/core/gvrender_core_ps.c
index 18afc7555..8169a46c4 100644
--- a/plugin/core/gvrender_core_ps.c
+++ b/plugin/core/gvrender_core_ps.c
@@ -138,7 +138,7 @@ static void psgen_begin_page(GVJ_t * job)
     if (job->common->show_boxes == NULL)
         fprintf(job->output_file, "gsave\n%d %d %d %d boxprim clip newpath\n",
 	    pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
-    fprintf(job->output_file, "gsave %g %g scale %d rotate %g %g translate\n",
+    fprintf(job->output_file, "gsave %g %g set_scale %d rotate %g %g translate\n",
 		job->scale.x, job->scale.y,
 		job->rotation,
 		job->translation.x, job->translation.y);
-- 
2.40.0