1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Better way to handle auto scrolling.

This commit is contained in:
Bartosz Taudul 2019-08-10 22:06:51 +02:00
parent 6fca188603
commit 530f293c49
2 changed files with 2 additions and 18 deletions

View File

@ -5964,24 +5964,10 @@ void View::DrawMessages()
}
m_visibleMessages = msgcnt;
if( !filterActive )
if( ImGui::GetScrollY() >= ImGui::GetScrollMaxY() )
{
const auto maxScroll = ImGui::GetScrollMaxY();
if( maxScroll != 0 )
{
const auto msgssize = msgs.size();
if( m_prevMessages == msgssize && !m_messageFilterWasActive )
{
m_messagesScrollBottom = ImGui::GetScrollY() == maxScroll;
}
else
{
m_prevMessages = msgssize;
if( m_messagesScrollBottom ) ImGui::SetScrollHereY();
}
}
ImGui::SetScrollHereY( 1.f );
}
m_messageFilterWasActive = filterActive;
ImGui::EndColumns();
ImGui::EndChild();

View File

@ -267,9 +267,7 @@ private:
ZoneEvent* m_zoneHover = nullptr;
int m_frameHover = -1;
bool m_messagesScrollBottom;
size_t m_prevMessages = 0;
ImGuiTextFilter m_messageFilter;
bool m_messageFilterWasActive = false;
int m_visibleMessages = 0;
bool m_disconnectIssued = false;