From 0f69a6d2062043902248444ad9655b70a07beeb7 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 20 Feb 2022 04:26:35 -0500 Subject: [PATCH] GUI: follow up to #191 --- src/gui/gui.cpp | 5 +++-- src/gui/gui.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 715b47bd5..9af907f01 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1618,13 +1618,14 @@ void FurnaceGUI::drawAbout() { } ImGui::PopFont(); - float timeScale = 60.0f * ImGui::GetIO().DeltaTime; + float timeScale=60.0f*ImGui::GetIO().DeltaTime; aboutHue+=(0.001+peakMix*0.004)*timeScale; aboutScroll+=(2+(peakMix>0.78)*3)*timeScale; aboutSin+=(1+(peakMix>0.75)*2)*timeScale; - if (aboutSin>=2400) aboutSin-=2400; + while (aboutHue>1) aboutHue--; + while (aboutSin>=2400) aboutSin-=2400; if (aboutScroll>(42*57+scrH)) aboutScroll=-20; } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_ABOUT; diff --git a/src/gui/gui.h b/src/gui/gui.h index 96e1c39bf..3e15b1417 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -417,7 +417,7 @@ class FurnaceGUI { double dpiScale; - int aboutScroll, aboutSin; + double aboutScroll, aboutSin; float aboutHue; ImFont* mainFont;