Reland "Factorize box layout functions. (#185)"" (#187)

This reverts commit a7095970bc.
This commit is contained in:
Arthur Sonzogni
2021-08-10 22:15:24 +02:00
committed by GitHub
parent 98f49a581c
commit 79b8928f6e
5 changed files with 141 additions and 166 deletions

View File

@@ -0,0 +1,24 @@
#ifndef FTXUI_DOM_BOX_HELPER_HPP
#define FTXUI_DOM_BOX_HELPER_HPP
#include <vector>
namespace ftxui {
namespace box_helper {
struct Element {
// Input:
int min_size = 0;
int flex_grow = 0;
int flex_shrink = 0;
// Output;
int size = 0;
};
void Compute(std::vector<Element>* elements, int target_size);
} // namespace box_helper
} // namespace ftxui
#endif /* end of include guard: FTXUI_DOM_BOX_HELPER_HPP */