# ``igraph`.`drawing`.`cairo`.`polygon`.`CairoPolygonDrawer``

class documentation

`class CairoPolygonDrawer(AbstractCairoDrawer): (source)`

Constructor: `CairoPolygonDrawer(context, bbox)`

View In Hierarchy

Class that is used to draw polygons in Cairo.

The corner points of the polygon can be set by the `points` property of the drawer, or passed at construction time. Most drawing methods in this class also have an extra `points` argument that can be used to override the set of points in the `points` property.

Method | `__init__` | Constructs a new polygon drawer that draws on the given Cairo context.
Method | `draw` | Draws the polygon using the current stroke of the Cairo context.
Method | `draw_path` | Sets up a Cairo path for the outline of a polygon on the given Cairo context.

Inherited from `AbstractCairoDrawer`:

Method | `bbox.setter` | Sets the bounding box of the drawing area where this drawer will draw.
Instance Variable | `context` | Undocumented
Property | `bbox` | The bounding box of the drawing area where this drawer will draw.
Method | `_mark_point` | Marks the given point with a small circle on the canvas. Used primarily for debugging purposes.
Instance Variable | `_bbox` | Undocumented

def __init__(self, context, bbox=(1, 1)): (source)
overrides `igraph.drawing.cairo.base.AbstractCairoDrawer.__init__`

Constructs a new polygon drawer that draws on the given Cairo context.

Parameters
context | the Cairo context to draw on
bbox | ignored, leave it at its default value

def draw(self, points): (source)
overrides `igraph.drawing.baseclasses.AbstractDrawer.draw`

Draws the polygon using the current stroke of the Cairo context.

Parameters
points | the coordinates of the corners of the polygon, in clockwise or counter-clockwise order.

def draw_path(self, points, corner_radius=0): (source)

Sets up a Cairo path for the outline of a polygon on the given Cairo context.

Parameters
points | the coordinates of the corners of the polygon, in clockwise or counter-clockwise order.
corner_radius | if zero, an ordinary polygon will be drawn. If positive, the corners of the polygon will be rounded with the given radius.