mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
parent
0186f8a463
commit
cecd54df42
@ -20,7 +20,7 @@ class GridBox : public Node {
|
||||
for (const auto& line : lines_)
|
||||
x_size = std::max(x_size, (int)line.size());
|
||||
for (auto& line : lines_) {
|
||||
while (line.size() < (size_t)y_size) {
|
||||
while (line.size() < (size_t)x_size) {
|
||||
line.push_back(filler());
|
||||
}
|
||||
}
|
||||
|
@ -569,6 +569,25 @@ TEST(GridboxTest, Horizontal_FlexGrow_NoFlex_FlewShrink) {
|
||||
}
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/ArthurSonzogni/FTXUI/issues/259
|
||||
TEST(GridboxTest, MissingCells) {
|
||||
auto root = gridbox({
|
||||
{cell("1"), cell("2"), cell("3")},
|
||||
{cell("4"), cell("5")},
|
||||
});
|
||||
|
||||
Screen screen(20, 7);
|
||||
Render(screen, root);
|
||||
EXPECT_EQ(screen.ToString(),
|
||||
"╭─╮╭─╮╭─╮ \r\n"
|
||||
"│1││2││3│ \r\n"
|
||||
"╰─╯╰─╯╰─╯ \r\n"
|
||||
"╭─╮╭─╮ \r\n"
|
||||
"│4││5│ \r\n"
|
||||
"╰─╯╰─╯ \r\n"
|
||||
" ");
|
||||
}
|
||||
|
||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
Loading…
Reference in New Issue
Block a user