11Box Box::Intersection(Box a, Box b) {
13 std::max(a.x_min, b.x_min),
14 std::min(a.x_max, b.x_max),
15 std::max(a.y_min, b.y_min),
16 std::min(a.y_max, b.y_max),
22Box Box::Union(Box a, Box b) {
24 std::min(a.x_min, b.x_min),
25 std::max(a.x_max, b.x_max),
26 std::min(a.y_min, b.y_min),
27 std::max(a.y_max, b.y_max),
34void Box::Shift(
int x,
int y) {
42bool Box::Contain(
int x,
int y)
const {
50bool Box::IsEmpty()
const {
51 return x_min > x_max || y_min > y_max;
55bool Box::operator==(
const Box& other)
const {
56 return (x_min == other.x_min) && (x_max == other.x_max) &&
57 (y_min == other.y_min) && (y_max == other.y_max);
61bool Box::operator!=(
const Box& other)
const {
62 return !operator==(other);
The FTXUI ftxui:: namespace.