]> granicus.if.org Git - graphviz/commitdiff
make_map_internal: flip the order of 'bounding_box_margin' if-then-else ladder
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Sep 2021 22:07:42 +0000 (15:07 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Sep 2021 17:22:20 +0000 (10:22 -0700)
Squashes a -Wfloat-equal warning.

cmd/gvmap/make_map.c

index d72bcb2fe9840124390a287be9463241a4e7d8a0..c7f81792c4027b0ef53221533c7a818cda4cab1d 100644 (file)
@@ -1133,12 +1133,12 @@ static int make_map_internal(int exclude_random, int include_OK_points,
       if (bounding_box_margin[i] > 0){
        xmin[i] -= bounding_box_margin[i];
        xmax[i] += bounding_box_margin[i];
-      } else if (bounding_box_margin[i] == 0) {/* auto bounding box */
-       xmin[i] -= MAX(boxsize[i]*0.2, 2.*shore_depth_tol);
-       xmax[i] += MAX(boxsize[i]*0.2, 2*shore_depth_tol);
-      } else {
+      } else if (bounding_box_margin[i] < 0) {
        xmin[i] -= boxsize[i]*(-bounding_box_margin[i]);
        xmax[i] += boxsize[i]*(-bounding_box_margin[i]);
+      } else { // auto bounding box
+       xmin[i] -= MAX(boxsize[i]*0.2, 2.*shore_depth_tol);
+       xmax[i] += MAX(boxsize[i]*0.2, 2*shore_depth_tol);
       }
     }
     if (Verbose) {