MCPcopy Index your code
hub / github.com/gonum/plot / FillPolygon

Method FillPolygon

vg/draw/canvas.go:532–545  ·  view source on GitHub ↗

FillPolygon fills a polygon with the given color.

(clr color.Color, pts []vg.Point)

Source from the content-addressed store, hash-verified

530
531// FillPolygon fills a polygon with the given color.
532func (c *Canvas) FillPolygon(clr color.Color, pts []vg.Point) {
533 if len(pts) == 0 {
534 return
535 }
536
537 c.SetColor(clr)
538 p := make(vg.Path, 0, len(pts)+1)
539 p.Move(pts[0])
540 for _, pt := range pts[1:] {
541 p.Line(pt)
542 }
543 p.Close()
544 c.Fill(p)
545}
546
547// ClipPolygonXY returns a slice of lines that
548// represent the given polygon clipped in both

Callers 12

ThumbnailMethod · 0.80
ThumbnailMethod · 0.80
PlotMethod · 0.80
PlotMethod · 0.80
PlotMethod · 0.80
ThumbnailMethod · 0.80
PlotMethod · 0.80
ThumbnailMethod · 0.80
ThumbnailMethod · 0.80
PlotMethod · 0.80
ThumbnailMethod · 0.80
ThumbnailMethod · 0.80

Implementers 7

teeCanvasvg/tee.go
Canvasvg/vgeps/vgeps.go
Canvasvg/vgtex/canvas.go
Canvasvg/vgimg/vgimg.go
Canvasvg/vgpdf/vgpdf.go
Canvasvg/recorder/recorder.go
Canvasvg/vgsvg/vgsvg.go

Calls 5

SetColorMethod · 0.95
FillMethod · 0.95
MoveMethod · 0.80
LineMethod · 0.80
CloseMethod · 0.80

Tested by 1

ThumbnailMethod · 0.64