From 672b39b172fe43b81548c04bd7a7fa7485b6d6a2 Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 6 Jan 2023 22:13:23 +0700 Subject: [PATCH] Rename latest_log_entries_read to autoscrolling --- event_loop.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/event_loop.cpp b/event_loop.cpp index 598f086..f9c3850 100644 --- a/event_loop.cpp +++ b/event_loop.cpp @@ -27,7 +27,7 @@ static inline void settings_window(Config& config, float* config_write_timer, bo ImGui::End(); } -static inline void logs_window(bool* latest_log_entries_read, bool* show_logs_window) { +static inline void logs_window(bool* autoscrolling, bool* show_logs_window) { if (!ImGui::Begin("LogMeow Logs", show_logs_window)) { ImGui::End(); return; @@ -46,7 +46,7 @@ static inline void logs_window(bool* latest_log_entries_read, bool* show_logs_wi if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar)) { ImGui::TextUnformatted(log_entries.data(), &log_entries[log_entries.size()]); if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) { - *latest_log_entries_read = true; + *autoscrolling = true; ImGui::SetScrollHereY(1.0f); } } @@ -137,9 +137,9 @@ void event_loop(Config& config, float* config_write_timer, bool* run_event_loop) } if (show_logs_window) { - bool latest_log_entries_read = false; - logs_window(&latest_log_entries_read, &show_logs_window); - if (latest_log_entries_read) { + bool autoscrolling = false; + logs_window(&autoscrolling, &show_logs_window); + if (autoscrolling) { log_entries_read = log_entries.size(); } }