Remove codecvt dependency. (#516)

This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/514
This commit is contained in:
Arthur Sonzogni (slow/sick)
2022-11-26 20:43:09 +01:00
committed by GitHub
parent 55b9706cfd
commit 05f29ff3b3
6 changed files with 201 additions and 71 deletions

View File

@@ -26,8 +26,8 @@ TEST(AnimationTest, StartAndEnd) {
animation::easing::BounceInOut,
};
for (auto& it : functions) {
EXPECT_NEAR(0.f, it(0.f), 1.0e-4);
EXPECT_NEAR(1.f, it(1.f), 1.0e-4);
EXPECT_NEAR(0.F, it(0.F), 1.0e-4);
EXPECT_NEAR(1.F, it(1.F), 1.0e-4);
}
}

View File

@@ -3,8 +3,9 @@
namespace ftxui {
// NOLINTNEXTLINE
Loop::Loop(ScreenInteractive* screen, Component component)
: screen_(screen), component_(component) {
: screen_(screen), component_(std::move(component)) {
screen_->PreMain();
}

View File

@@ -366,7 +366,7 @@ CapturedMouse ScreenInteractive::CaptureMouse() {
}
void ScreenInteractive::Loop(Component component) { // NOLINT
class Loop loop(this, component);
class Loop loop(this, std::move(component));
loop.Run();
}
@@ -559,12 +559,13 @@ void ScreenInteractive::RunOnceBlocking(Component component) {
RunOnce(component);
}
// NOLINTNEXTLINE
void ScreenInteractive::RunOnce(Component component) {
Task task;
while (task_receiver_->ReceiveNonBlocking(&task)) {
HandleTask(component, task);
}
Draw(component);
Draw(std::move(component));
}
void ScreenInteractive::HandleTask(Component component, Task& task) {
@@ -620,8 +621,9 @@ void ScreenInteractive::HandleTask(Component component, Task& task) {
// NOLINTNEXTLINE
void ScreenInteractive::Draw(Component component) {
if (frame_valid_)
if (frame_valid_) {
return;
}
auto document = component->Render();
int dimx = 0;
int dimy = 0;