mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 15:51:04 +08:00
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:
parent
7ff4cb5ca4
commit
0a437d6e48
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user