]> granicus.if.org Git - graphviz/commitdiff
Replace hard-coded 2 with Ndim
authorEmden R. Gansner <erg@emdenrg.net>
Tue, 14 Mar 2017 22:18:16 +0000 (18:18 -0400)
committerEmden R. Gansner <erg@emdenrg.net>
Tue, 14 Mar 2017 22:18:16 +0000 (18:18 -0400)
lib/neatogen/adjust.c

index 3f36fa2a28b763801a796b960012279d48a0d6ee..3d55360c49f442c7ee206815b06e695d3c18c68a 100644 (file)
@@ -671,7 +671,7 @@ static void updateGraph(Agraph_t * graph)
 double *getSizes(Agraph_t * g, pointf pad, int* n_elabels, int** elabels)
 {
     Agnode_t *n;
-    real *sizes = N_GNEW(2 * agnnodes(g), real);
+    real *sizes = N_GNEW(Ndim * agnnodes(g), real);
     int i, nedge_nodes = 0;
     int* elabs;
 
@@ -679,8 +679,8 @@ double *getSizes(Agraph_t * g, pointf pad, int* n_elabels, int** elabels)
        if (elabels && IS_LNODE(n)) nedge_nodes++;
 
        i = ND_id(n);
-       sizes[i * 2] = ND_width(n) * .5 + pad.x;
-       sizes[i * 2 + 1] = ND_height(n) * .5 + pad.y;
+       sizes[i * Ndim] = ND_width(n) * .5 + pad.x;
+       sizes[i * Ndim + 1] = ND_height(n) * .5 + pad.y;
     }
 
     if (elabels && nedge_nodes) {