Add returns a rect that encompasses both the current rect and the given rect.
(q Rect)
| 449 | |
| 450 | // Add returns a rect that encompasses both the current rect and the given rect. |
| 451 | func (r Rect) Add(q Rect) Rect { |
| 452 | x0 := math.Min(r.X0, q.X0) |
| 453 | y0 := math.Min(r.Y0, q.Y0) |
| 454 | x1 := math.Max(r.X1, q.X1) |
| 455 | y1 := math.Max(r.Y1, q.Y1) |
| 456 | return Rect{x0, y0, x1, y1} |
| 457 | } |
| 458 | |
| 459 | // AddPoint returns a rect that encompasses both the current rect and the given point. |
| 460 | func (r Rect) AddPoint(p Point) Rect { |
no outgoing calls