21 using NodeDecorator::NodeDecorator;
23 void ComputeRequirement()
override {
24 Node::ComputeRequirement();
25 requirement_ = children_[0]->requirement();
29 void SetBox(
Box box)
override {
31 if (box_.x_min > box_.x_max)
33 children_[0]->SetBox(box);
41 int size_inner = box_.
y_max - box_.y_min;
42 int size_outter = stencil.
y_max - stencil.
y_min;
43 if (size_outter >= size_inner)
46 int start_y = 2 * stencil.
y_min + 2 * float(stencil.
y_min - box_.y_min) *
47 (size_outter - 1) / size_inner;
48 int size = 2 * float(size_outter) * (size_outter - 1) / size_inner + 2;
51 const int x = stencil.
x_max;
52 for (
int y = stencil.
y_min; y <= stencil.
y_max; ++y) {
53 bool up = (2 * y + -1 >= start_y) && (2 * y - 1 <= start_y +
size);
54 bool down = (2 * y - 0 >= start_y) && (2 * y - 0 <= start_y +
size);
56 const char* c = up ? (down ?
"┃" :
"╹") : (down ?
"╻" :
" ");
62 return std::make_shared<Impl>(std::move(child));