mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
parent
90d18a2d20
commit
436c237213
@ -174,9 +174,9 @@ void EventListener(std::atomic<bool>* quit, Sender<Task> out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const size_t buffer_size = 100;
|
const size_t buffer_size = 100;
|
||||||
std::array<char, buffer_size> buffer; // NOLINT;
|
std::array<char, buffer_size> buffer; // NOLINT;
|
||||||
int l = read(fileno(stdin), buffer.data(), buffer_size); // NOLINT
|
size_t l = read(fileno(stdin), buffer.data(), buffer_size); // NOLINT
|
||||||
for (int i = 0; i < l; ++i) {
|
for (size_t i = 0; i < l; ++i) {
|
||||||
parser.Add(buffer[i]); // NOLINT
|
parser.Add(buffer[i]); // NOLINT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ void SetY(Global& g, std::vector<Line> lines) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FlexboxConfig::AlignContent::Stretch: {
|
case FlexboxConfig::AlignContent::Stretch: {
|
||||||
for (int i = ys.size() - 1; i >= 0; --i) { // NOLINT
|
for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
|
||||||
const int shifted = remaining_space * (i + 0) / (i + 1);
|
const int shifted = remaining_space * (i + 0) / (i + 1);
|
||||||
ys[i] += shifted;
|
ys[i] += shifted;
|
||||||
const int consumed = remaining_space - shifted;
|
const int consumed = remaining_space - shifted;
|
||||||
@ -172,7 +172,7 @@ void SetY(Global& g, std::vector<Line> lines) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FlexboxConfig::AlignContent::SpaceBetween: {
|
case FlexboxConfig::AlignContent::SpaceBetween: {
|
||||||
for (int i = ys.size() - 1; i >= 1; --i) { // NOLINT
|
for (int i = static_cast<int>(ys.size()) - 1; i >= 1; --i) { // NOLINT
|
||||||
ys[i] += remaining_space;
|
ys[i] += remaining_space;
|
||||||
remaining_space = remaining_space * (i - 1) / i;
|
remaining_space = remaining_space * (i - 1) / i;
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ void SetY(Global& g, std::vector<Line> lines) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FlexboxConfig::AlignContent::SpaceAround: {
|
case FlexboxConfig::AlignContent::SpaceAround: {
|
||||||
for (int i = ys.size() - 1; i >= 0; --i) { // NOLINT
|
for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
|
||||||
ys[i] += remaining_space * (2 * i + 1) / (2 * i + 2);
|
ys[i] += remaining_space * (2 * i + 1) / (2 * i + 2);
|
||||||
remaining_space = remaining_space * (2 * i) / (2 * i + 2);
|
remaining_space = remaining_space * (2 * i) / (2 * i + 2);
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ void SetY(Global& g, std::vector<Line> lines) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FlexboxConfig::AlignContent::SpaceEvenly: {
|
case FlexboxConfig::AlignContent::SpaceEvenly: {
|
||||||
for (int i = ys.size() - 1; i >= 0; --i) { // NOLINT
|
for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
|
||||||
ys[i] += remaining_space * (i + 1) / (i + 2);
|
ys[i] += remaining_space * (i + 1) / (i + 2);
|
||||||
remaining_space = remaining_space * (i + 1) / (i + 2);
|
remaining_space = remaining_space * (i + 1) / (i + 2);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user