]> granicus.if.org Git - graphviz/commitdiff
Fix bug in computing nearest node
authorerg <devnull@localhost>
Mon, 31 Mar 2008 18:01:26 +0000 (18:01 +0000)
committererg <devnull@localhost>
Mon, 31 Mar 2008 18:01:26 +0000 (18:01 +0000)
lib/topfish/hierarchy.c

index 81002e4bf6f998a33ed3fb765841700e2b5aace5..b066bb5b5de069aa7259e472b96bae2142b9272b 100644 (file)
@@ -978,7 +978,7 @@ set_active_levels(Hierarchy * hierarchy, int *foci_nodes, int num_foci)
 }
 
 /* findClosestActiveNode:
- * Find 
+ * 
  */
 static double
 findClosestActiveNode(Hierarchy * hierarchy, int node,
@@ -1041,8 +1041,8 @@ find_closest_active_node(Hierarchy * hierarchy, double x, double y,
     double min_dist = 1e20;
 
     for (i = 0; i < hierarchy->nvtxs[top_level]; i++) {
-       findClosestActiveNode(hierarchy, i, top_level, x, y, min_dist,
-                             &closest_node, &closest_node_level);
+       min_dist = findClosestActiveNode(hierarchy, i, top_level, x, y, 
+           min_dist, &closest_node, &closest_node_level);
     }
     *closest_fine_node =
        find_leftmost_descendant(hierarchy, closest_node,