-void draw_rect(cairo_t *c, double x, double y, double w, double h, double r)
-{
- if (r > 0.0) {
- double c1 = 0.55228475 * r;
-
- cairo_move_to(c, x+r, y);
- cairo_rel_line_to(c, w-2*r, 0);
- cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r);
- cairo_rel_line_to(c, 0, h-2*r);
- cairo_rel_curve_to(c, 0.0, c1, c1-r, r, -r, r);
- cairo_rel_line_to (c, -w +2*r, 0);
- cairo_rel_curve_to (c, -c1, 0, -r, -c1, -r, -r);
- cairo_rel_line_to (c, 0, -h + 2 * r);
- cairo_rel_curve_to (c, 0, -c1, r - c1, -r, r, -r);
- }
- else
- cairo_rectangle(c, x, y, w, h);
-}
-
-