20 return [a = std::move(a), b = std::move(b)](
Element element) {
21 return b(a(std::move(element)));
41 return compose(std::move(a),
50 output.reserve(elements.size());
51 for (
auto& it : elements) {
52 output.push_back(std::move(it) | decorator);
71 return decorator(std::move(element));
103 const int max_iteration = 20;
105 e->ComputeRequirement();
108 box.
x_max = std::min(box.
x_max, e->requirement().min_x);
109 box.
y_max = e->requirement().min_y;
110 if (!extend_beyond_screen) {
123 box.
x_max = std::min(e->requirement().min_x, fullsize.
dimx);
124 box.
y_max = e->requirement().min_y;
127 if (!extend_beyond_screen) {
141 class Impl :
public Node {
142 void ComputeRequirement()
override {
143 requirement_.min_x = 0;
144 requirement_.min_y = 0;
147 return std::make_unique<Impl>();
Dimensions Fit(Element &, bool extend_beyond_screen=false)
std::function< Element(Element)> Decorator
Element nothing(Element element)
A decoration doing absolutely nothing.
std::shared_ptr< Node > Element
Component operator|(Component component, ComponentDecorator decorator)
std::vector< Element > Elements
Component & operator|=(Component &component, ComponentDecorator decorator)