We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f6e4a0 commit 2cdd9b4Copy full SHA for 2cdd9b4
src/chat.cpp
@@ -97,6 +97,8 @@ void ChatBuffer::step(f32 dtime)
97
98
void ChatBuffer::deleteOldest(u32 count)
99
{
100
+ bool at_bottom = (m_scroll == getBottomScrollPos());
101
+
102
u32 del_unformatted = 0;
103
u32 del_formatted = 0;
104
@@ -120,6 +122,11 @@ void ChatBuffer::deleteOldest(u32 count)
120
122
121
123
m_unformatted.erase(m_unformatted.begin(), m_unformatted.begin() + del_unformatted);
124
m_formatted.erase(m_formatted.begin(), m_formatted.begin() + del_formatted);
125
126
+ if (at_bottom)
127
+ m_scroll = getBottomScrollPos();
128
+ else
129
+ scrollAbsolute(m_scroll - del_formatted);
130
}
131
132
void ChatBuffer::deleteByAge(f32 maxAge)
0 commit comments