]> granicus.if.org Git - graphviz/commitdiff
dotsplines.c: rephrase some open coded fmin, fmax
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 7 Oct 2021 03:43:31 +0000 (20:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Oct 2021 18:15:10 +0000 (11:15 -0700)
lib/dotgen/dotsplines.c

index 26b38bb222ed1fb5f0ee3f270be4bfca32462316..b85686e9776778aaa5d5275cb41d5aa5b249a40d 100644 (file)
@@ -2189,8 +2189,7 @@ void refineregularends(edge_t *left, edge_t *right, pathend_t *endp, int dir,
            pp = cp;
        }
        i = dir == 1 ? 0 : *boxnp - 1;
-       if (boxes[i].LL.x > endp->boxes[endp->boxn - 1].UR.x - MINW)
-           boxes[i].LL.x = endp->boxes[endp->boxn - 1].UR.x - MINW;
+       boxes[i].LL.x = fmin(boxes[i].LL.x, endp->boxes[endp->boxn - 1].UR.x - MINW);
     }
     if (right) {
        if (!(rspls = getsplinepoints(right))) return;
@@ -2208,8 +2207,7 @@ void refineregularends(edge_t *left, edge_t *right, pathend_t *endp, int dir,
            pp = cp;
        }
        i = dir == 1 ? 0 : *boxnp - 1;
-       if (boxes[i].UR.x < endp->boxes[endp->boxn - 1].LL.x + MINW)
-           boxes[i].UR.x = endp->boxes[endp->boxn - 1].LL.x + MINW;
+       boxes[i].UR.x = fmax(boxes[i].UR.x, endp->boxes[endp->boxn - 1].LL.x + MINW);
     }
 }
 #endif