root = mkTree (g,gp,ap,mp);
total = root->area;
- root->r = rectangle_new(0, 0, sqrt(total + 0.1), sqrt(total + 0.1));
+ root->r = (rectangle){{0, 0}, {sqrt(total + 0.1), sqrt(total + 0.1)}};
layoutTree(root);
walkTree(root);
freeTree (root);
squarify(n, area, recs, nadded, maxarea, minarea, totalarea, asp, fillrec);
return recs;
}
-
-/* rectangle_new:
- * Create and initialize a new rectangle structure
- */
-rectangle rectangle_new(double x, double y, double width, double height){
- rectangle r;
- r.x[0] = x;
- r.x[1] = y;
- r.size[0] = width;
- r.size[1] = height;
- return r;
-}
} rectangle;
extern rectangle* tree_map(int n, double *area, rectangle fillrec);
-
-extern rectangle rectangle_new(double x, double y, double width, double height);