17 class Reflect :
public Node {
19 Reflect(
Element child, Box& box)
20 : Node(unpack(std::move(child))), reflected_box_(box) {}
22 void ComputeRequirement() final {
24 requirement_ = children_[0]->requirement();
27 void SetBox(Box box)
final {
30 children_[0]->SetBox(box);
33 void Render(Screen& screen)
final {
45 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