MCPcopy Create free account
hub / github.com/cogentcore/core / Thumbnail

Method Thumbnail

plot/plots/scatter.go:81–93  ·  view source on GitHub ↗

Thumbnail the thumbnail for the Scatter, implementing the plot.Thumbnailer interface.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

79// Thumbnail the thumbnail for the Scatter,
80// implementing the plot.Thumbnailer interface.
81func (pts *Scatter) Thumbnail(plt *plot.Plot) {
82 if !pts.LineStyle.SetStroke(plt) {
83 return
84 }
85 pc := plt.Paint
86 pts.PointSize.ToDots(&pc.UnitContext)
87 pc.FillStyle.Color = pts.LineStyle.Color
88 ptb := pc.Bounds
89 midX := 0.5 * float32(ptb.Min.X+ptb.Max.X)
90 midY := 0.5 * float32(ptb.Min.Y+ptb.Max.Y)
91
92 DrawShape(pc, math32.Vec2(midX, midY), pts.PointSize.Dots, pts.PointShape)
93}

Callers

nothing calls this directly

Calls 4

Vec2Function · 0.92
DrawShapeFunction · 0.85
SetStrokeMethod · 0.45
ToDotsMethod · 0.45

Tested by

no test coverage detected