Fixed mouse position in sf::Input not properly updated after a call to Window::SetCursorPosition

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1527 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-06-25 10:35:55 +00:00
parent 7ff4cb5ca4
commit 0a437d6e48

View File

@ -401,7 +401,14 @@ void Window::OnResize()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Window::FilterEvent(const Event& event) bool Window::FilterEvent(const Event& event)
{ {
// Discard MouseMove events generated by SetCursorPosition // Notify the input object
myInput.OnEvent(event);
// Notify resize events to the derived class
if (event.Type == Event::Resized)
OnResize();
// Don't forward to the user MouseMove events generated by SetCursorPosition
if ((event.Type == Event::MouseMoved) && if ((event.Type == Event::MouseMoved) &&
(event.MouseMove.X == mySetCursorPosX) && (event.MouseMove.X == mySetCursorPosX) &&
(event.MouseMove.Y == mySetCursorPosY)) (event.MouseMove.Y == mySetCursorPosY))
@ -411,13 +418,6 @@ bool Window::FilterEvent(const Event& event)
return false; return false;
} }
// Notify resize events to the derived class
if (event.Type == Event::Resized)
OnResize();
// Notify the input object
myInput.OnEvent(event);
return true; return true;
} }