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
x | the X coordinate of the top left corner of the rectangle |
y | the Y coordinate to the top left corner of the rectangle |
width | the width of the rectangle |
height | the height of the rectangle |