15class Unselectable :
public NodeDecorator {
19 void Select(Selection&
ignored)
override {
40 std::min(start_x, end_x),
41 std::max(start_x, end_x),
42 std::min(start_y, end_y),
43 std::max(start_y, end_y),
57 std::min(start_x, end_x),
58 std::max(start_x, end_x),
59 std::min(start_y, end_y),
60 std::max(start_y, end_y),
76 int start_x = start_x_;
77 int start_y = start_y_;
84 start_y < end_y || (start_y == end_y && start_x <= end_x);
105 start_x, start_y, end_x, end_y, parent_,
114 int start_x = start_x_;
115 int start_y = start_y_;
122 start_y < end_y || (start_y == end_y && start_x <= end_x);
143 return {start_x, start_y, end_x, end_y, parent_};
147 if (parent_ !=
this) {
152 if (parts_.str().empty()) {
158 parts_ <<
'\n' <<
part;
162 if (x_ == left + 1) {
NodeDecorator(Element child)
Represent a selection in the terminal.
const Box & GetBox() const
Get the box of the selection.
void AddPart(const std::string &part, int y, int left, int right)
Selection SaturateVertical(Box box)
Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its...
Selection()
Create an empty selection.
Selection SaturateHorizontal(Box box)
Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its...
std::shared_ptr< T > Make(Args &&... args)
bool Contain(int x, int y) const