14class Unselectable :
public NodeDecorator {
18 void Select(Selection& ignored)
override {
19 std::ignore = ignored;
39 std::min(start_x, end_x),
40 std::max(start_x, end_x),
41 std::min(start_y, end_y),
42 std::max(start_y, end_y),
56 std::min(start_x, end_x),
57 std::max(start_x, end_x),
58 std::min(start_y, end_y),
59 std::max(start_y, end_y),
75 int start_x = start_x_;
76 int start_y = start_y_;
80 const bool start_outside = !box.
Contain(start_x, start_y);
81 const bool end_outside = !box.
Contain(end_x, end_y);
82 const bool properly_ordered =
83 start_y < end_y || (start_y == end_y && start_x <= end_x);
84 if (properly_ordered) {
104 start_x, start_y, end_x, end_y, parent_,
113 int start_x = start_x_;
114 int start_y = start_y_;
118 const bool start_outside = !box.
Contain(start_x, start_y);
119 const bool end_outside = !box.
Contain(end_x, end_y);
120 const bool properly_ordered =
121 start_y < end_y || (start_y == end_y && start_x <= end_x);
123 if (properly_ordered) {
142 return {start_x, start_y, end_x, end_y, parent_};
146 if (parent_ !=
this) {
151 if (parts_.str().empty()) {
157 parts_ <<
'\n' << part;
161 if (x_ ==
left + 1) {
NodeDecorator(Element child)
const Box & GetBox() const
取得選取範圍的方塊。
void AddPart(const std::string &part, int y, int left, int right)
Selection SaturateVertical(Box box)
將選取範圍飽和在方塊內。 這是由 vbox 呼叫,用於將選取範圍傳播到其子元素。
Selection SaturateHorizontal(Box box)
將選取範圍飽和在方塊內。 這是由 hbox 呼叫,用於將選取範圍傳播到其子元素。
bool Contain(int x, int y) const