18class Reflect :
public Node {
20 Reflect(
Element child, Box& box)
21 : Node(unpack(std::move(child))), reflected_box_(box) {}
23 void ComputeRequirement() final {
25 requirement_ = children_[0]->requirement();
28 void SetBox(Box box)
final {
31 children_[0]->SetBox(box);
34 void Render(Screen& screen)
final {
46 return std::make_shared<Reflect>(std::move(child), box);
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
virtual void ComputeRequirement()
Compute how much space an elements needs.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element
Decorator reflect(Box &box)
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
static auto Intersection(Box a, Box b) -> Box