Skip to content

Commit

Permalink
Merge pull request #1794 from ericoporto/fix-mouse-boundaries
Browse files Browse the repository at this point in the history
Engine: prevent cursor from leaving game area
  • Loading branch information
ivan-mogilko committed Oct 2, 2022
2 parents 4556c66 + 8cf4999 commit 2c73c51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Engine/device/mousew32.cpp
Expand Up @@ -101,8 +101,8 @@ void mgetgraphpos()
else
{
// Save real cursor coordinates provided by system
real_mouse_x = sys_mouse_x;
real_mouse_y = sys_mouse_y;
real_mouse_x = Math::Clamp((int)sys_mouse_x, Mouse::ControlRect.Left, Mouse::ControlRect.Right);
real_mouse_y = Math::Clamp((int)sys_mouse_y, Mouse::ControlRect.Top, Mouse::ControlRect.Bottom);
}

// Set new in-game cursor position
Expand Down

0 comments on commit 2c73c51

Please sign in to comment.