mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-19 18:18:09 +08:00
Fix focus vs flexbox interaction. (#405)
- Fix focus in flexbox. This required resetting the focus state at the beginning of the ComputeRequirement(), because it can now run several times. This resolves:https://github.com/ArthurSonzogni/FTXUI/issues/399 - Add Box::Union. - Add a preliminary implementation of forwarding selected_box from within the flexbox.
This commit is contained in:
@@ -15,6 +15,18 @@ Box Box::Intersection(Box a, Box b) {
|
||||
};
|
||||
}
|
||||
|
||||
/// @return the smallest Box containing both |a| and |b|.
|
||||
/// @ingroup screen
|
||||
// static
|
||||
Box Box::Union(Box a, Box b) {
|
||||
return Box{
|
||||
std::min(a.x_min, b.x_min),
|
||||
std::max(a.x_max, b.x_max),
|
||||
std::min(a.y_min, b.y_min),
|
||||
std::max(a.y_max, b.y_max),
|
||||
};
|
||||
}
|
||||
|
||||
/// @return whether (x,y) is contained inside the box.
|
||||
/// @ingroup screen
|
||||
bool Box::Contain(int x, int y) const {
|
||||
|
@@ -20,8 +20,8 @@ namespace ftxui {
|
||||
|
||||
namespace {
|
||||
|
||||
bool g_cached = false;
|
||||
Terminal::Color g_cached_supported_color;
|
||||
bool g_cached = false; // NOLINT
|
||||
Terminal::Color g_cached_supported_color; // NOLINT
|
||||
|
||||
Dimensions& FallbackSize() {
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
|
Reference in New Issue
Block a user