()
| 23 | } |
| 24 | |
| 25 | func (r *Rectangle) bounds() (x1, y1, x2, y2 int) { |
| 26 | x1, y1 = r.X1, r.Y1 |
| 27 | x2, y2 = r.X2, r.Y2 |
| 28 | if x1 > x2 { |
| 29 | x1, x2 = x2, x1 |
| 30 | } |
| 31 | if y1 > y2 { |
| 32 | y1, y2 = y2, y1 |
| 33 | } |
| 34 | return |
| 35 | } |
| 36 | |
| 37 | func (r *Rectangle) Draw(dc *gg.Context, scale float64) { |
| 38 | x1, y1, x2, y2 := r.bounds() |