Function Context.rectangle

Adds a closed sub-path rectangle of the given size to the current path at position r.point in user-space coordinates. This function is logically equivalent to:

cr.moveTo(r.point);
cr.relLineTo(r.width, 0);
cr.relLineTo(0, r.height);
cr.relLineTo(-r.width, 0);
cr.closePath();

Prototypes

void rectangle(
  Rectangle!(double) r
);

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

Authors

Johannes Pfau cairoD
Andrej Mitrovic cairoD
cairo team cairo

Copyright

License

cairoD wrapper/bindings Boost License 1.0
cairo LGPL 2.1 / MPL 1.1