MCPcopy
hub / github.com/fogleman/primitive / Draw

Method Draw

primitive/rectangle.go:99–107  ·  view source on GitHub ↗
(dc *gg.Context, scale float64)

Source from the content-addressed store, hash-verified

97}
98
99func (r *RotatedRectangle) Draw(dc *gg.Context, scale float64) {
100 sx, sy := float64(r.Sx), float64(r.Sy)
101 dc.Push()
102 dc.Translate(float64(r.X), float64(r.Y))
103 dc.Rotate(radians(float64(r.Angle)))
104 dc.DrawRectangle(-sx/2, -sy/2, sx, sy)
105 dc.Pop()
106 dc.Fill()
107}
108
109func (r *RotatedRectangle) SVG(attrs string) string {
110 return fmt.Sprintf(

Callers

nothing calls this directly

Calls 1

radiansFunction · 0.85

Tested by

no test coverage detected