Implement Node::Select for flexbox. (#977)

This commit is contained in:
Arthur Sonzogni
2025-03-21 16:15:25 +01:00
committed by GitHub
parent f2fb434e31
commit 96e8b8d92e
4 changed files with 102 additions and 37 deletions

View File

@@ -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