]> granicus.if.org Git - graphviz/commitdiff
Provide some decimal precision to xdot coordinates and sizes.
authorEmden R. Gansner <erg@chinstrap.client.research.att.com>
Wed, 31 Jul 2013 17:29:22 +0000 (13:29 -0400)
committerEmden R. Gansner <erg@chinstrap.client.research.att.com>
Wed, 31 Jul 2013 17:29:22 +0000 (13:29 -0400)
lib/common/output.c
plugin/core/gvrender_core_dot.c

index 88508a2f16532f16b28d8b676f386949f85842f1..a9f393878c967164c75bdc59ed91b43e7cc39a01 100644 (file)
@@ -481,7 +481,7 @@ void attach_attrs(graph_t * g)
 void output_point(agxbuf *xbuf, pointf p)
 {
     char buf[BUFSIZ];
-    sprintf(buf, "%d %d ", ROUND(p.x), ROUND(YDIR(p.y)));
+    sprintf(buf, "%.02f %.02f ", (p.x), (YDIR(p.y)));
     agxbput(xbuf, buf);
 }
 
index 42b05717bacd391ac5b1eb81b560e604d2a049b1..ded8a45fdfadd8d376c1df6c45052bd10ae7b4e7 100644 (file)
@@ -55,7 +55,7 @@ typedef enum {
 //    #pragma comment( lib, "ingraphs.lib" )
 #endif
 
-#define XDOTVERSION "1.2"
+#define XDOTVERSION "1.3"
 
 #define NUMXBUFS (EMIT_HLABEL+1)
 /* There are as many xbufs as there are values of emit_state_t.
@@ -510,7 +510,7 @@ static void xdot_textpara(GVJ_t * job, pointf p, textpara_t * para)
     char buf[BUFSIZ];
     int j;
     
-    sprintf(buf, "F %f ", para->fontsize);
+    sprintf(buf, "F %.01f ", para->fontsize);
     agxbput(xbufs[emit_state], buf);
     xdot_str (job, "", para->fontname);
     xdot_pencolor(job);
@@ -529,7 +529,7 @@ static void xdot_textpara(GVJ_t * job, pointf p, textpara_t * para)
     }
     agxbput(xbufs[emit_state], "T ");
     output_point(xbufs[emit_state], p);
-    sprintf(buf, "%d %d ", j, (int) para->width);
+    sprintf(buf, "%d %.02f ", j, para->width);
     agxbput(xbufs[emit_state], buf);
     xdot_str (job, "", para->str);
 }
@@ -549,7 +549,7 @@ static void xdot_ellipse(GVJ_t * job, pointf * A, int filled)
     else
         agxbput(xbufs[emit_state], "e ");
     output_point(xbufs[emit_state], A[0]);
-    sprintf(buf, "%d %d ", ROUND(A[1].x - A[0].x), ROUND(A[1].y - A[0].y));
+    sprintf(buf, "%.02f %.02f ", (A[1].x - A[0].x), (A[1].y - A[0].y));
     agxbput(xbufs[emit_state], buf);
 }
 
@@ -591,7 +591,7 @@ void core_loadimage_xdot(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
     
     agxbput(xbufs[emit_state], "I ");
     output_point(xbufs[emit_state], b.LL);
-    sprintf(buf, "%d %d ", ROUND(b.UR.x - b.LL.x), ROUND(b.UR.y - b.LL.y));
+    sprintf(buf, "%.02f %.02f ", (b.UR.x - b.LL.x), (b.UR.y - b.LL.y));
     agxbput(xbufs[emit_state], buf);
     xdot_str (job, "", (char*)(us->name));
 }