func dragRect(cvs *canvas.Canvas, m draw.Mouse, mc <-chan draw.Mouse) draw.Rectangle { m0 := m r := draw.Rectangle{m0.Point, m0.Point} b := newBox(cvs, r) cvs.Flush() for m.Buttons != 0 { m = <-mc b.setRect(draw.Rectangle{m0.Point, m.Point}.Canon()) cvs.Flush() } b.delete(cvs) cvs.Flush() return draw.Rectangle{m0.Point, m.Point}.Canon() }