diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp index a3eb665d03..529e03ec2f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp @@ -423,15 +423,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage m_anchor.y = m_currentPos.y - maxY; } - offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.x - m_anchor.x); - offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.y - m_anchor.y); + // TheSuperHackers @fix Mauller 16/06/2025 fix RMB scrolling to allow it to scale with the user adjusted scroll factor Coord2D vec; - vec.x = offset.x; - vec.y = offset.y; + vec.x = (m_currentPos.x - m_anchor.x); + vec.y = (m_currentPos.y - m_anchor.y); + // TheSuperHackers @info calculate the length of the vector to obtain the movement speed before the vector is normalized + float vecLength = vec.length(); vec.normalize(); - // Add in the window scroll amount as the minimum. - offset.x += TheGlobalData->m_horizontalScrollSpeedFactor * vec.x * sqr(TheGlobalData->m_keyboardScrollFactor); - offset.y += TheGlobalData->m_verticalScrollSpeedFactor * vec.y * sqr(TheGlobalData->m_keyboardScrollFactor); + offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * TheGlobalData->m_keyboardScrollFactor; + offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * TheGlobalData->m_keyboardScrollFactor; } break; case SCROLL_KEY: diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp index b554f8e54d..695fdde063 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp @@ -422,15 +422,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage m_anchor.y = m_currentPos.y - maxY; } - offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.x - m_anchor.x); - offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.y - m_anchor.y); + // TheSuperHackers @fix Mauller 16/06/2025 fix RMB scrolling to allow it to scale with the user adjusted scroll factor Coord2D vec; - vec.x = offset.x; - vec.y = offset.y; + vec.x = (m_currentPos.x - m_anchor.x); + vec.y = (m_currentPos.y - m_anchor.y); + // TheSuperHackers @info calculate the length of the vector to obtain the movement speed before the vector is normalized + float vecLength = vec.length(); vec.normalize(); - // Add in the window scroll amount as the minimum. - offset.x += TheGlobalData->m_horizontalScrollSpeedFactor * vec.x * sqr(TheGlobalData->m_keyboardScrollFactor); - offset.y += TheGlobalData->m_verticalScrollSpeedFactor * vec.y * sqr(TheGlobalData->m_keyboardScrollFactor); + offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * TheGlobalData->m_keyboardScrollFactor; + offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * TheGlobalData->m_keyboardScrollFactor; } break; case SCROLL_KEY: