Skip to content

Commit

Permalink
Fix console scrolling with touch input being too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
Robyt3 committed Jan 16, 2025
1 parent 99ef458 commit 4845fc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/game/client/components/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,20 +1131,20 @@ void CGameConsole::OnRender()
{
pConsole->m_MouseRelease = GetMousePosition();
}
const float ScaledRowHeight = RowHeight / ScreenSize.y;
if(absolute(m_TouchState.m_ScrollAmount.y) >= ScaledRowHeight)
const float ScaledLineHeight = LineHeight / ScreenSize.y;
if(absolute(m_TouchState.m_ScrollAmount.y) >= ScaledLineHeight)
{
if(m_TouchState.m_ScrollAmount.y > 0.0f)
{
pConsole->m_BacklogCurLine += pConsole->GetLinesToScroll(-1, 1);
m_TouchState.m_ScrollAmount.y -= ScaledRowHeight;
m_TouchState.m_ScrollAmount.y -= ScaledLineHeight;
}
else
{
--pConsole->m_BacklogCurLine;
if(pConsole->m_BacklogCurLine < 0)
pConsole->m_BacklogCurLine = 0;
m_TouchState.m_ScrollAmount.y += ScaledRowHeight;
m_TouchState.m_ScrollAmount.y += ScaledLineHeight;
}
pConsole->m_HasSelection = false;
}
Expand Down

0 comments on commit 4845fc8

Please sign in to comment.