From 4845fc8a0edb0e3bbcef730014ef3948aab93d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 16 Jan 2025 20:16:58 +0100 Subject: [PATCH] Fix console scrolling with touch input being too slow --- src/game/client/components/console.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 3ce0d7a21b0..ddac7afdc7f 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -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; }