DrawGlyph implements the Glyph interface.
(c *Canvas, sty GlyphStyle, pt vg.Point)
| 254 | |
| 255 | // DrawGlyph implements the Glyph interface. |
| 256 | func (PlusGlyph) DrawGlyph(c *Canvas, sty GlyphStyle, pt vg.Point) { |
| 257 | c.SetLineStyle(LineStyle{Color: sty.Color, Width: vg.Points(0.5)}) |
| 258 | r := sty.Radius |
| 259 | p := make(vg.Path, 0, 2) |
| 260 | p.Move(vg.Point{X: pt.X, Y: pt.Y + r}) |
| 261 | p.Line(vg.Point{X: pt.X, Y: pt.Y - r}) |
| 262 | c.Stroke(p) |
| 263 | p = p[:0] |
| 264 | p.Move(vg.Point{X: pt.X - r, Y: pt.Y}) |
| 265 | p.Line(vg.Point{X: pt.X + r, Y: pt.Y}) |
| 266 | c.Stroke(p) |
| 267 | } |
| 268 | |
| 269 | // CrossGlyph is a glyph that draws a big X. |
| 270 | type CrossGlyph struct{} |
nothing calls this directly
no test coverage detected