14 using NodeDecorator::NodeDecorator;
16 void ComputeRequirement()
override {
17 Node::ComputeRequirement();
18 requirement_ = children_[0]->requirement();
22 void SetBox(
Box box)
override {
24 if (box_.x_min > box_.x_max)
26 children_[0]->SetBox(box);
34 int size_inner = box_.
y_max - box_.y_min;
35 int size_outter = stencil.
y_max - stencil.
y_min;
36 if (size_outter >= size_inner)
39 int start_y = 2 * stencil.
y_min + 2 * float(stencil.
y_min - box_.y_min) *
40 (size_outter - 1) / size_inner;
41 int size = 2 * float(size_outter) * (size_outter - 1) / size_inner + 2;
44 const int x = stencil.
x_max;
45 for (
int y = stencil.
y_min; y <= stencil.
y_max; ++y) {
46 bool up = (2 * y + -1 >= start_y) && (2 * y - 1 <= start_y +
size);
47 bool down = (2 * y - 0 >= start_y) && (2 * y - 0 <= start_y +
size);
49 const char* c = up ? (down ?
"┃" :
"╹") : (down ?
"╻" :
" ");
55 return std::make_shared<Impl>(std::move(child));