]> git.mxchange.org Git - flightgear.git/commitdiff
Update to latest SimGear and fix eating up every 2nd scroll event
authorThomas Geymayer <tomgey@gmail.com>
Thu, 13 Dec 2012 22:39:41 +0000 (23:39 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Thu, 13 Dec 2012 22:39:41 +0000 (23:39 +0100)
src/Canvas/gui_mgr.cxx
src/Canvas/window.cxx
src/Canvas/window.hxx

index efd3f94e1cfc90453f4db58c30bcf9a908bac0a8..0190ba9f6b0afd7f023522edfc52295daf3dc262 100644 (file)
@@ -305,8 +305,6 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
   event->state = ea.getButtonMask();
   event->mod = ea.getModKeyMask();
 
-  static simgear::Rect<float> resize_region;
-
   if( !_resize_window.expired() )
   {
     switch( ea.getEventType() )
@@ -353,7 +351,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
 
   if( window_at_cursor )
   {
-    const simgear::Rect<float>& reg = window_at_cursor->getRegion();
+    const SGRect<float>& reg = window_at_cursor->getRegion();
 
     if(     window_at_cursor->isResizable()
         && (  ea.getEventType() == osgGA::GUIEventAdapter::MOVE
@@ -434,7 +432,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
       // duplicate events, so lets ignore the second event with the same
       // timestamp.
       if( _last_scroll_time == ea.getTime() )
-        return true;
+        return window_at_cursor ? true : false;
       _last_scroll_time = ea.getTime();
 
       event->type = sc::Event::WHEEL;
index 57d862fa4a157a2641d5a66fc529811bd17cc261..8c0494b4729a680183afe26ed3a86bfd7172178c 100644 (file)
@@ -89,7 +89,7 @@ namespace canvas
   }
 
   //----------------------------------------------------------------------------
-  const simgear::Rect<float>& Window::getRegion() const
+  const SGRect<float>& Window::getRegion() const
   {
     return _image.getRegion();
   }
index 3b31623b0a9b0099c75830b7802007c80a86f78e..46fb48ee2c43a2f1b2cf88202e73613f2e3ae3f5 100644 (file)
@@ -51,7 +51,7 @@ namespace canvas
       virtual void valueChanged(SGPropertyNode* node);
 
       osg::Group* getGroup();
-      const simgear::Rect<float>& getRegion() const;
+      const SGRect<float>& getRegion() const;
 
       void setCanvas(simgear::canvas::CanvasPtr canvas);
       simgear::canvas::CanvasWeakPtr getCanvas() const;