1
0
Fork 0

don't use uninitialized variables

This commit is contained in:
Torsten Dreyer 2011-10-09 21:37:52 +02:00
parent 9a21896a33
commit 7431c14ba6

View file

@ -215,11 +215,13 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
button = 3;
else if (ea.getScrollingDeltaY() < 0)
button = 4;
else
button = -1;
} else if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP)
button = 3;
else
button = 4;
if (mouseClickHandler) {
if (mouseClickHandler && button != -1) {
(*mouseClickHandler)(button, 0, x, y, mainWindow, &ea);
(*mouseClickHandler)(button, 1, x, y, mainWindow, &ea);
}