mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-29 16:39:34 +08:00
Implement Node::Select for flexbox. (#977)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace ftxui::flexbox_helper {
|
||||
|
||||
// A block is a rectangle in the flexbox.
|
||||
struct Block {
|
||||
// Input:
|
||||
int min_size_x = 0;
|
||||
@@ -28,13 +29,24 @@ struct Block {
|
||||
bool overflow = false;
|
||||
};
|
||||
|
||||
// A line is a row of blocks.
|
||||
struct Line {
|
||||
std::vector<Block*> blocks;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int dim_x = 0;
|
||||
int dim_y = 0;
|
||||
};
|
||||
|
||||
struct Global {
|
||||
std::vector<Block> blocks;
|
||||
std::vector<Line> lines;
|
||||
FlexboxConfig config;
|
||||
int size_x;
|
||||
int size_y;
|
||||
};
|
||||
|
||||
|
||||
void Compute(Global& global);
|
||||
|
||||
} // namespace ftxui::flexbox_helper
|
||||
|
Reference in New Issue
Block a user