# FTXUI: box.hpp Source File

Loading...
Searching...
No Matches
box.hpp
Go to the documentation of this file.
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef FTXUI_SCREEN_BOX_HPP
#define FTXUI_SCREEN_BOX_HPP
namespace ftxui {
/// @brief Box is a structure that represents a rectangular area in a 2D space.
///
/// It is defined by its minimum and maximum coordinates along the x and y axes.
/// Note that the coordinates are inclusive, meaning that the box includes both
/// the minimum and maximum values.
///
/// @ingroup screen
struct Box {
int x_min = 0;
int x_max = 0;
int y_min = 0;
int y_max = 0;
static auto Intersection(Box a, Box b) -> Box;
static auto Union(Box a, Box b) -> Box;
void Shift(int x, int y);
bool Contain(int x, int y) const;
bool IsEmpty() const;
bool operator==(const Box& other) const;
bool operator!=(const Box& other) const;
};
} // namespace ftxui
#endif // FTXUI_SCREEN_BOX_HPP
ftxui::Box::operator!=
bool operator!=(const Box &other) const
Definition box.cpp:61
ftxui::Box::Contain
bool Contain(int x, int y) const
Definition box.cpp:42
ftxui::Box::Shift
void Shift(int x, int y)
Definition box.cpp:34
ftxui::Box::x_max
int x_max
Definition box.hpp:18
ftxui::Box::y_min
int y_min
Definition box.hpp:19
ftxui::Box::Intersection
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
ftxui::Box::IsEmpty
bool IsEmpty() const
Definition box.cpp:50
ftxui::Box::y_max
int y_max
Definition box.hpp:20
ftxui::Box::operator==
bool operator==(const Box &other) const
Definition box.cpp:55
ftxui::Box::Union
static auto Union(Box a, Box b) -> Box
Definition box.cpp:22
ftxui::Box::x_min
int x_min
Definition box.hpp:17
ftxui::Box
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10