14class Unselectable :
public NodeDecorator {
18 void Select(Selection&)
override {
38 std::min(start_x, end_x),
39 std::max(start_x, end_x),
40 std::min(start_y, end_y),
41 std::max(start_y, end_y),
55 std::min(start_x, end_x),
56 std::max(start_x, end_x),
57 std::min(start_y, end_y),
58 std::max(start_y, end_y),
74 int start_x = start_x_;
75 int start_y = start_y_;
82 start_y < end_y || (start_y == end_y && start_x <= end_x);
102 return Selection(start_x, start_y, end_x, end_y, parent_);
110 int start_x = start_x_;
111 int start_y = start_y_;
118 start_y < end_y || (start_y == end_y && start_x <= end_x);
139 return Selection(start_x, start_y, end_x, end_y, parent_);
143 if (parent_ !=
this) {
147 if (parts_.str().empty()) {
153 parts_ <<
'\n' <<
part;
157 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)