]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/FGEventHandler.cxx
Hopefully fix the shadow disappearing because of range animation issue in a more...
[flightgear.git] / src / Main / FGEventHandler.cxx
index 950ccfd1003e01e112a6134f3865113cb2fc2aca..936b02fc34ac19ecbb3ba01d8460ba8989f1551c 100644 (file)
@@ -39,7 +39,7 @@ FGEventHandler::FGEventHandler() :
     keyHandler(0),
     mouseClickHandler(0),
     mouseMotionHandler(0),
-    statsHandler(new osgViewer::StatsHandler),
+    statsHandler(new FGStatsHandler),
     statsEvent(new osgGA::GUIEventAdapter),
     statsType(osgViewer::StatsHandler::NO_STATS),
     currentModifiers(0),
@@ -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);
         }
@@ -237,9 +239,11 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
             (*mouseMotionHandler)(x, y);
         return true;
     case osgGA::GUIEventAdapter::RESIZE:
+        SG_LOG(SG_VIEW, SG_DEBUG, "FGEventHandler::handle: RESIZE event " << ea.getWindowHeight() << " x " << ea.getWindowWidth() << ", resizable: " << resizable);
         CameraGroup::getDefault()->resized();
         if (resizable)
           globals->get_renderer()->resize(ea.getWindowWidth(), ea.getWindowHeight());
+        statsHandler->handle(ea, us);
       #ifdef SG_MAC
         // work around OSG Cocoa-Viewer issue with resize event handling,
         // where resize events are queued up, then dispatched in a batch, with