main component fade update

This commit is contained in:
turanszkij
2019-04-27 13:02:16 +02:00
parent 10bde0d59e
commit d9719d23a1
2 changed files with 18 additions and 9 deletions
+17 -8
View File
@@ -84,14 +84,23 @@ void MainComponent::ActivatePath(RenderPath* component, float fadeSeconds, const
return;
}
// Fade manager will activate on fadeout
fadeManager.Clear();
fadeManager.Start(fadeSeconds, fadeColor, [this,component]() {
if (fadeSeconds > 0)
{
// Fade manager will activate on fadeout
fadeManager.Clear();
fadeManager.Start(fadeSeconds, fadeColor, [this, component]() {
if (component == nullptr)
{
return;
}
if (activePath != nullptr)
{
activePath->Stop();
}
component->Start();
activePath = component;
});
}
else
{
if (activePath != nullptr)
{
@@ -100,7 +109,7 @@ void MainComponent::ActivatePath(RenderPath* component, float fadeSeconds, const
component->Start();
activePath = component;
});
}
}
void MainComponent::Run()