Context.rectangle

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>

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

Parameters

x double

the X coordinate of the top left corner of the rectangle

y double

the Y coordinate to the top left corner of the rectangle

width double

the width of the rectangle

height double

the height of the rectangle