MCPcopy Create free account
hub / github.com/chrxh/alien / process

Method process

source/Gui/UiController.cpp:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void UiController::process()
35{
36 if (_lastChangeTimePoint) {
37 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
38 std::chrono::steady_clock::now() - *_lastChangeTimePoint)
39 .count();
40 if (_on) {
41 ImGui::GetStyle().Alpha = toFloat(std::min(duration, FadeInOutDuration)) / FadeInOutDuration;
42 if (ImGui::GetStyle().Alpha == 1) {
43 _lastChangeTimePoint = std::nullopt;
44 }
45 }
46 else {
47 ImGui::GetStyle().Alpha =
48 toFloat(std::max(FadeInOutDuration - duration, std::chrono::milliseconds::rep(0))) / FadeInOutDuration;
49 if (ImGui::GetStyle().Alpha == 0) {
50 _lastChangeTimePoint = std::nullopt;
51 }
52 }
53 }
54}

Callers

nothing calls this directly

Calls 1

toFloatFunction · 0.85

Tested by

no test coverage detected