]> granicus.if.org Git - graphviz/commitdiff
For boxes, enforce x and y symmetry, so that horizontal and vertical
authorerg <devnull@localhost>
Mon, 26 Apr 2010 18:00:56 +0000 (18:00 +0000)
committererg <devnull@localhost>
Mon, 26 Apr 2010 18:00:56 +0000 (18:00 +0000)
edges are truly such. We should probably add some mechanism to handle
such symmetries for other built-in shapes.

lib/common/shapes.c

index 5cda19ef40e7573203cd4c5c160d1d9ccc138872..a7203c2f348f8ab2c320fe23a87b4c1d658ac348 100644 (file)
@@ -974,6 +974,15 @@ static void poly_init(node_t * n)
 
            /* store result in array of points */
            vertices[i] = P;
+           if (isBox) { /* enforce exact symmetry of box */
+               vertices[1].x = -P.x;
+               vertices[1].y = P.y;
+               vertices[2].x = -P.x;
+               vertices[2].y = -P.y;
+               vertices[3].x = P.x;
+               vertices[3].y = -P.y;
+               break;
+           }
        }
 
        /* apply minimum dimensions */