MCPcopy Create free account
hub / github.com/fogleman/primitive / SVG

Method SVG

primitive/polygon.go:42–52  ·  view source on GitHub ↗
(attrs string)

Source from the content-addressed store, hash-verified

40}
41
42func (p *Polygon) SVG(attrs string) string {
43 ret := fmt.Sprintf(
44 "<polygon %s points=\"",
45 attrs)
46 points := make([]string, len(p.X))
47 for i := 0; i < len(p.X); i++ {
48 points[i] = fmt.Sprintf("%f,%f", p.X[i], p.Y[i])
49 }
50
51 return ret + strings.Join(points, ",") + "\" />"
52}
53
54func (p *Polygon) Copy() Shape {
55 a := *p

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected