]> granicus.if.org Git - graphviz/commitdiff
changed shore length default to a more reasonable setting
authoryifanhu <devnull@localhost>
Fri, 1 Apr 2011 17:12:26 +0000 (17:12 +0000)
committeryifanhu <devnull@localhost>
Fri, 1 Apr 2011 17:12:26 +0000 (17:12 +0000)
cmd/gvmap/make_map.c

index 715b8eef11b4b13f8608595870a97b9f9aeafd25..0d458dfcee072c90fc84923ff9069a24f02ec98e 100644 (file)
@@ -2183,8 +2183,12 @@ int make_map_from_rectangle_groups(int exclude_random, int include_OK_points,
     if (shore_depth_tol < 0) {
       shore_depth_tol = -(shore_depth_tol)*avgsz;
     } else if (shore_depth_tol == 0){
+      real area;
       get_boundingbox(n, dim, x, sizes, bbox);
-      shore_depth_tol = MIN(bbox[1] - bbox[0], bbox[3] - bbox[2])*0.05;
+      //shore_depth_tol = MIN(bbox[1] - bbox[0], bbox[3] - bbox[2])*0.05;
+      area = (bbox[1] - bbox[0])*(bbox[3] - bbox[2]);
+      shore_depth_tol = sqrt(area/(real) n); 
+      if (Verbose) fprintf(stderr,"setting shore length ======%f\n",shore_depth_tol);
     } else {
       /*
       get_boundingbox(n, dim, x, sizes, bbox);