Thumbnail creates the thumbnail for the Polygon, implementing the plot.Thumbnailer interface.
(c *draw.Canvas)
| 111 | // Thumbnail creates the thumbnail for the Polygon, |
| 112 | // implementing the plot.Thumbnailer interface. |
| 113 | func (pts *Polygon) Thumbnail(c *draw.Canvas) { |
| 114 | if pts.Color != nil { |
| 115 | points := []vg.Point{ |
| 116 | {X: c.Min.X, Y: c.Min.Y}, |
| 117 | {X: c.Min.X, Y: c.Max.Y}, |
| 118 | {X: c.Max.X, Y: c.Max.Y}, |
| 119 | {X: c.Max.X, Y: c.Min.Y}, |
| 120 | } |
| 121 | poly := c.ClipPolygonY(points) |
| 122 | c.FillPolygon(pts.Color, poly) |
| 123 | |
| 124 | points = append(points, vg.Point{X: c.Min.X, Y: c.Min.Y}) |
| 125 | c.StrokeLines(pts.LineStyle, points) |
| 126 | } else { |
| 127 | y := c.Center().Y |
| 128 | c.StrokeLine2(pts.LineStyle, c.Min.X, y, c.Max.X, y) |
| 129 | } |
| 130 | } |
nothing calls this directly
no test coverage detected