| 84 | } |
| 85 | |
| 86 | Rectangle Rectangle::Shared(const Rectangle& a, const Rectangle& b) |
| 87 | { |
| 88 | const float left = Math::Max(a.GetLeft(), b.GetLeft()); |
| 89 | const float right = Math::Min(a.GetRight(), b.GetRight()); |
| 90 | const float top = Math::Max(a.GetTop(), b.GetTop()); |
| 91 | const float bottom = Math::Min(a.GetBottom(), b.GetBottom()); |
| 92 | return Rectangle(left, top, Math::Max(right - left, 0.0f), Math::Max(bottom - top, 0.0f)); |
| 93 | } |
| 94 | |
| 95 | Rectangle Rectangle::FromPoints(const Float2& p1, const Float2& p2) |
| 96 | { |