Don't hide mouse cursor if it's outside the window

This commit is contained in:
2014-04-14 14:15:53 -04:00
parent 5f9be1cb6a
commit fa551c8f43

View File

@@ -1614,6 +1614,9 @@ bool handle_keystroke(sf::Event& event){
if (in_startup_mode == true) if (in_startup_mode == true)
return false; return false;
// Only hide the cursor if it's in the window.
// This is because we want to show it as soon as the mouse moves, but we don't receive mouse move events if it's outside the window.
if(sf::IntRect(mainPtr.getPosition(), sf::Vector2i(mainPtr.getSize())).contains(sf::Mouse::getPosition()))
mainPtr.setMouseCursorVisible(false); mainPtr.setMouseCursorVisible(false);
// DEBUG // DEBUG