Add mouse implementation of most components.

This commit is contained in:
ArthurSonzogni
2021-04-18 22:33:41 +02:00
parent d685a8655e
commit 890a41a64c
20 changed files with 239 additions and 12 deletions

View File

@@ -14,6 +14,16 @@ Box Box::Intersection(Box a, Box b) {
std::min(a.y_max, b.y_max),
};
}
/// @return whether (x,y) is contained inside the box.
/// @ingroup screen
bool Box::Contain(int x, int y) {
return x_min <= x && //
x_max >= x && //
y_min <= y && //
y_max >= y;
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.