(out *op.Iterator)
| 12 | type Rect struct{ X, Y, W, H int32 } |
| 13 | |
| 14 | func (r Rect) Draw(out *op.Iterator) { |
| 15 | out.Start() |
| 16 | *out.MoveTo() = op.MoveTo{r.X, r.Y} |
| 17 | *out.LineTo() = op.LineTo{r.X + r.W, r.Y} |
| 18 | *out.LineTo() = op.LineTo{r.X + r.W, r.Y + r.H} |
| 19 | *out.LineTo() = op.LineTo{r.X, r.Y + r.H} |
| 20 | out.Close() |
| 21 | } |
| 22 | |
| 23 | func (r Rect) Render(out *op.Iterator) { |
| 24 | r.Draw(out) |