Add autoscroll
This commit is contained in:
parent
3bf47f3a5c
commit
11eb08b08f
|
@ -41,11 +41,13 @@ static inline void logs_window(bool* show_logs_window) {
|
|||
ImGui::SetClipboardText(log_entries.c_str());
|
||||
}
|
||||
|
||||
// copied from imgui/imgui_demo.cpp: [SECTION] Example App: Debug Console / ShowExampleAppConsole()
|
||||
|
||||
ImGui::Separator();
|
||||
// copied from imgui/imgui_demo.cpp: [SECTION] Example App: Debug Console / ShowExampleAppConsole()
|
||||
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()) {
|
||||
ImGui::SetScrollHereY(1.0f);
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::End();
|
||||
|
|
Loading…
Reference in New Issue