From d79dad28d0089db8369d95c6dcd33e7ecc6f5c7e Mon Sep 17 00:00:00 2001 From: olsner Date: Mon, 16 Aug 2004 14:33:26 +0000 Subject: [PATCH] Fixed scrolling for windowed mode - stop scrolling when the mouse moves outside the window This was SVN commit r1005. --- source/graphics/GameView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index a2a0f351b5..0bbaa15658 100755 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -310,14 +310,14 @@ void CGameView::Update(float DeltaTime) if( !hotkeys[HOTKEY_CAMERA_ROTATE] && !hotkeys[HOTKEY_CAMERA_ROTATE_ABOUT_TARGET] ) { - if (mouse_x >= g_xres-2) + if (mouse_x >= g_xres-2 && mouse_x < g_xres) m_Camera.m_Orientation.Translate(rightwards * (m_ViewScrollSpeed * DeltaTime)); - else if (mouse_x <= 3) + else if (mouse_x <= 3 && mouse_x >= 0) m_Camera.m_Orientation.Translate(-rightwards * (m_ViewScrollSpeed * DeltaTime)); - if (mouse_y >= g_yres-2) + if (mouse_y >= g_yres-2 && mouse_y < g_yres) m_Camera.m_Orientation.Translate(-forwards_horizontal * (m_ViewScrollSpeed * DeltaTime)); - else if (mouse_y <= 3) + else if (mouse_y <= 3 && mouse_y >= 0) m_Camera.m_Orientation.Translate(forwards_horizontal * (m_ViewScrollSpeed * DeltaTime)); }