mirror of https://github.com/stella-emu/stella.git
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:
parent
975d221606
commit
87e3a71580
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue