Skip to content

Commit 2b1cc28

Browse files
authored
Merge pull request ddnet#9543 from Robyt3/Client-Touch-Console-Scroll-Fix
Fix console scrolling with touch input being too slow
2 parents 6d89940 + 4845fc8 commit 2b1cc28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/game/client/components/console.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,20 +1131,20 @@ void CGameConsole::OnRender()
11311131
{
11321132
pConsole->m_MouseRelease = GetMousePosition();
11331133
}
1134-
const float ScaledRowHeight = RowHeight / ScreenSize.y;
1135-
if(absolute(m_TouchState.m_ScrollAmount.y) >= ScaledRowHeight)
1134+
const float ScaledLineHeight = LineHeight / ScreenSize.y;
1135+
if(absolute(m_TouchState.m_ScrollAmount.y) >= ScaledLineHeight)
11361136
{
11371137
if(m_TouchState.m_ScrollAmount.y > 0.0f)
11381138
{
11391139
pConsole->m_BacklogCurLine += pConsole->GetLinesToScroll(-1, 1);
1140-
m_TouchState.m_ScrollAmount.y -= ScaledRowHeight;
1140+
m_TouchState.m_ScrollAmount.y -= ScaledLineHeight;
11411141
}
11421142
else
11431143
{
11441144
--pConsole->m_BacklogCurLine;
11451145
if(pConsole->m_BacklogCurLine < 0)
11461146
pConsole->m_BacklogCurLine = 0;
1147-
m_TouchState.m_ScrollAmount.y += ScaledRowHeight;
1147+
m_TouchState.m_ScrollAmount.y += ScaledLineHeight;
11481148
}
11491149
pConsole->m_HasSelection = false;
11501150
}

0 commit comments

Comments
 (0)