mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Feature: Selection
Add support for selection content in the dom.
This commit is contained in:
@@ -64,6 +64,19 @@ class HBox : public Node {
|
||||
x = box.x_max + 1;
|
||||
}
|
||||
}
|
||||
|
||||
void Select(Selection& selection) override {
|
||||
// If this Node box_ doesn't intersect with the selection, then no
|
||||
// selection.
|
||||
if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Selection selection_saturated = selection.SaturateHorizontal(box_);
|
||||
for (auto& child : children_) {
|
||||
child->Select(selection_saturated);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user