FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
box.hpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. 保留所有權利。
2// 本原始碼的使用受 MIT 授權條款的約束,該條款可在 LICENSE 檔案中找到。
3#ifndef FTXUI_SCREEN_BOX_HPP
4#define FTXUI_SCREEN_BOX_HPP
5
6namespace ftxui {
7
8/// @brief Box 是一個表示二維空間中矩形區域的結構。
9///
10/// 它由其沿 x 軸和 y 軸的最小和最大座標定義。
11/// 請注意,座標是包含性的,這表示該框包含最小值和最大值。
12///
13/// @ingroup screen
14struct Box {
15 int x_min = 0;
16 int x_max = 0;
17 int y_min = 0;
18 int y_max = 0;
19
20 static auto Intersection(Box a, Box b) -> Box;
21 static auto Union(Box a, Box b) -> Box;
22 void Shift(int x, int y);
23 bool Contain(int x, int y) const;
24 bool IsEmpty() const;
25 bool operator==(const Box& other) const;
26 bool operator!=(const Box& other) const;
27};
28
29} // namespace ftxui
30
31#endif // FTXUI_SCREEN_BOX_HPP
bool operator!=(const Box &other) const
Definition box.cpp:61
bool Contain(int x, int y) const
Definition box.cpp:42
void Shift(int x, int y)
Definition box.cpp:34
int x_max
Definition box.hpp:16
int y_min
Definition box.hpp:17
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
bool IsEmpty() const
Definition box.cpp:50
int y_max
Definition box.hpp:18
bool operator==(const Box &other) const
Definition box.cpp:55
static auto Union(Box a, Box b) -> Box
Definition box.cpp:22
int x_min
Definition box.hpp:15
Box 是一個表示二維空間中矩形區域的結構。
Definition box.hpp:14
FTXUI 的 ftxui:: 命名空間
Definition animation.hpp:10