Fix bug with unwanted mouse movement after changing video modes.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2239 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2011-05-28 01:14:14 +00:00
parent 975d221606
commit 87e3a71580
1 changed files with 6 additions and 2 deletions

View File

@ -646,7 +646,11 @@ void EventHandler::poll(uInt64 time)
if(myMouseEnabled) if(myMouseEnabled)
{ {
int x = event.motion.xrel, y = event.motion.yrel; int x = event.motion.xrel, y = event.motion.yrel;
// Filter out extremely large movement, which is usually caused
// by a screen being re-created
if(abs(x) < 100)
myEvent->set(Event::MouseAxisXValue, x); myEvent->set(Event::MouseAxisXValue, x);
if(abs(y) < 100)
myEvent->set(Event::MouseAxisYValue, y); myEvent->set(Event::MouseAxisYValue, y);
} }
} }