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

Method SVG

primitive/rectangle.go:43–50  ·  view source on GitHub ↗
(attrs string)

Source from the content-addressed store, hash-verified

41}
42
43func (r *Rectangle) SVG(attrs string) string {
44 x1, y1, x2, y2 := r.bounds()
45 w := x2 - x1 + 1
46 h := y2 - y1 + 1
47 return fmt.Sprintf(
48 "<rect %s x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" />",
49 attrs, x1, y1, w, h)
50}
51
52func (r *Rectangle) Copy() Shape {
53 a := *r

Callers

nothing calls this directly

Calls 1

boundsMethod · 0.95

Tested by

no test coverage detected