]> granicus.if.org Git - graphviz/commitdiff
mkMaze: abbreviate some open coded 'fmax'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Mar 2022 03:49:54 +0000 (19:49 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Mar 2022 18:32:34 +0000 (11:32 -0700)
lib/ortho/maze.c

index a90ea124b1477bc60b750a95c3870b00293f5d16..fef49dde966e540bc90d8e24f6265a319cf2f994 100644 (file)
@@ -463,10 +463,8 @@ mkMaze (graph_t* g, int doLbls)
     BB.LL.x = BB.LL.y = MAXDOUBLE;
     BB.UR.x = BB.UR.y = -MAXDOUBLE;
     for (n = agfstnode (g); n; n = agnxtnode(g,n)) {
-        w2 = ND_xsize(n)/2.0;
-       if (w2 < 1) w2 = 1;
-        h2 = ND_ysize(n)/2.0;
-       if (h2 < 1) h2 = 1;
+        w2 = fmax(1, ND_xsize(n) / 2.0);
+        h2 = fmax(1, ND_ysize(n) / 2.0);
         bb.LL.x = ND_coord(n).x - w2;
         bb.UR.x = ND_coord(n).x + w2;
         bb.LL.y = ND_coord(n).y - h2;