// Draw given poligon path, automatically closing first and last point func (i *Image) DrawPoly(points ...float64) { C.cairo_move_to(i.Ctx, C.double(points[0]), C.double(points[1])) for j := 2; j < len(points); j += 2 { C.cairo_line_to(i.Ctx, C.double(points[j]), C.double(points[j+1])) } C.cairo_close_path(i.Ctx) }
func (self *Surface) ClosePath() { C.cairo_close_path(self.context) }
// ClosePath is a wrapper around cairo_close_path(). func (v *Context) ClosePath() { C.cairo_close_path(v.native()) }
//ClosePath adds a line segment from the current point to the beginning //of the current sub-path and closes the sub-path. //After this call the current point will be at the joined endpoint of the //sub-path. // //The behavior of ClosePath is distinct from simply calling LineTo with the //equivalent coordinate in the case of stroking. //When a closed sub-path is stroked, there are no caps on the ends of the //sub-path. //Instead, there is a line join connecting the final and initial segments //of the sub-path. // //If there is no current point, this method will have no effect. // //ClosePath will place an explicit PathMoveTo following the PathClosePath into //the current path. func (c *Context) ClosePath() *Context { C.cairo_close_path(c.c) return c }