Beispiel #1
0
func (r Rect) Draw(out *op.Iterator) {
	out.Start()
	*out.MoveTo() = op.MoveTo{r.X, r.Y}
	*out.LineTo() = op.LineTo{r.X + r.W, r.Y}
	*out.LineTo() = op.LineTo{r.X + r.W, r.Y + r.H}
	*out.LineTo() = op.LineTo{r.X, r.Y + r.H}
	out.Close()
}
Beispiel #2
0
func (r Rect) Render(out *op.Iterator) {
	r.Draw(out)
	out.Fill()
	out.Stroke()
}