]> granicus.if.org Git - graphviz/commitdiff
Fix bug 1064
authorerg <devnull@localhost>
Sun, 14 Jan 2007 22:29:50 +0000 (22:29 +0000)
committererg <devnull@localhost>
Sun, 14 Jan 2007 22:29:50 +0000 (22:29 +0000)
lib/dotgen/dotsplines.c

index 88beba0396733fd004529c5bad11a4c1e362af55..17d64bb75073d2b257b3a5c562b75fa43dc0631b 100644 (file)
@@ -212,10 +212,15 @@ static void edge_normalize(graph_t * g)
     }
 }
 
-/* dot_splines:
+/* _dot_splines:
+ * Main spline routing code.
+ * The normalize parameter allows this function to be called by the
+ * recursive call in make_flat_edge without normalization occurring,
+ * so that the edge will only be normalized once in the top level call
+ * of dot_splines.
  * If the splines attribute is defined but equal to "", skip edge routing.
  */
-void dot_splines(graph_t * g)
+static void _dot_splines(graph_t * g, int normalize)
 {
     int i, j, k, n_nodes, n_edges, ind, cnt;
     node_t *n;
@@ -381,7 +386,8 @@ void dot_splines(graph_t * g)
 
     /* normalize splines so they always go from tail to head */
     /* place_portlabel relies on this being done first */
-    edge_normalize(g);
+    if (normalize)
+       edge_normalize(g);
 
     /* vladimir: place port labels */
     /* FIX: head and tail labels are not part of cluster bbox */
@@ -414,6 +420,14 @@ void dot_splines(graph_t * g)
     State = GVSPLINES;
 }
 
+/* dot_splines:
+ * If the splines attribute is defined but equal to "", skip edge routing.
+ */
+void dot_splines(graph_t * g)
+{
+    _dot_splines (g, 1);
+}
+
 /* place_vnlabel:
  * assign position of an edge label from its virtual node
  * This is for regular edges only.
@@ -846,7 +860,7 @@ make_flat_adj_edges(path* P, edge_t** edges, int ind, int cnt, edge_t* e0)
        else ND_coord_i(n).y = midx;
     }
     dot_sameports(auxg);
-    dot_splines(auxg);
+    _dot_splines(auxg, 0);
     dotneato_postprocess(auxg);
 
        /* copy splines */