Context.rectangle

void rectangle(double x, double y, double width, double height)

Adds a closed sub-path rectangle of the given size to the current path at position (x, y) in user-space coordinates.

This function is logically equivalent to:

<informalexample><programlisting>

cairo_move_to (cr, x, y); cairo_rel_line_to (cr, width, 0); cairo_rel_line_to (cr, 0, height); cairo_rel_line_to (cr, -width, 0); cairo_close_path (cr);

</programlisting></informalexample>

Parameters

xthe X coordinate of the top left corner of the rectangle
ythe Y coordinate to the top left corner of the rectangle
widththe width of the rectangle
heightthe height of the rectangle