From 0a437d6e48ab2699d522881443a138d66598eb9d Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Fri, 25 Jun 2010 10:35:55 +0000 Subject: [PATCH] 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 --- src/SFML/Window/Window.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index d8ea5274..7a775fa8 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -401,7 +401,14 @@ void Window::OnResize() //////////////////////////////////////////////////////////// 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) && (event.MouseMove.X == mySetCursorPosX) && (event.MouseMove.Y == mySetCursorPosY)) @@ -411,13 +418,6 @@ bool Window::FilterEvent(const Event& event) return false; } - // Notify resize events to the derived class - if (event.Type == Event::Resized) - OnResize(); - - // Notify the input object - myInput.OnEvent(event); - return true; }