]> granicus.if.org Git - graphviz/commitdiff
clamp -ve node margins to 0
authorellson <devnull@localhost>
Fri, 28 Jul 2006 03:16:47 +0000 (03:16 +0000)
committerellson <devnull@localhost>
Fri, 28 Jul 2006 03:16:47 +0000 (03:16 +0000)
lib/common/shapes.c

index a029454620ea0fa5b4f668403953f435f55508ee..04a158faa8dc4d0f30c31d3b93e8e849a8604744 100644 (file)
@@ -527,6 +527,8 @@ static void poly_init(node_t * n)
        /* padding */
        if ((p = agget(n, "margin"))) {
            i = sscanf(p, "%lf,%lf", &marginx, &marginy);
+           if (marginx < 0) marginx = 0;
+           if (marginy < 0) marginy = 0;
            if (i > 0) {
                dimen.x += 2 * POINTS(marginx);
                if (i > 1)