From: Thomas Geymayer Date: Thu, 13 Dec 2012 22:39:41 +0000 (+0100) Subject: Update to latest SimGear and fix eating up every 2nd scroll event X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9976155d67731cfcd7bd300840125b8c7be290b;p=flightgear.git Update to latest SimGear and fix eating up every 2nd scroll event --- diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx index efd3f94e1..0190ba9f6 100644 --- a/src/Canvas/gui_mgr.cxx +++ b/src/Canvas/gui_mgr.cxx @@ -305,8 +305,6 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea) event->state = ea.getButtonMask(); event->mod = ea.getModKeyMask(); - static simgear::Rect 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& reg = window_at_cursor->getRegion(); + const SGRect& 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; diff --git a/src/Canvas/window.cxx b/src/Canvas/window.cxx index 57d862fa4..8c0494b47 100644 --- a/src/Canvas/window.cxx +++ b/src/Canvas/window.cxx @@ -89,7 +89,7 @@ namespace canvas } //---------------------------------------------------------------------------- - const simgear::Rect& Window::getRegion() const + const SGRect& Window::getRegion() const { return _image.getRegion(); } diff --git a/src/Canvas/window.hxx b/src/Canvas/window.hxx index 3b31623b0..46fb48ee2 100644 --- a/src/Canvas/window.hxx +++ b/src/Canvas/window.hxx @@ -51,7 +51,7 @@ namespace canvas virtual void valueChanged(SGPropertyNode* node); osg::Group* getGroup(); - const simgear::Rect& getRegion() const; + const SGRect& getRegion() const; void setCanvas(simgear::canvas::CanvasPtr canvas); simgear::canvas::CanvasWeakPtr getCanvas() const;