Skip to content

Commit b0f3d4e

Browse files
Marco Bernasocchipka
authored andcommitted
fixed homeHandler
1 parent 7a96956 commit b0f3d4e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/plugins/globe/globe_plugin.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void GlobePlugin::setupMap()
259259
struct PanControlHandler : public NavigationControlHandler
260260
{
261261
PanControlHandler( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
262-
virtual void onMouseDown( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
262+
virtual void onMouseDown( Control* control, int mouseButtonMask )
263263
{
264264
_manip->pan( _dx, _dy );
265265
}
@@ -272,7 +272,7 @@ struct PanControlHandler : public NavigationControlHandler
272272
struct RotateControlHandler : public NavigationControlHandler
273273
{
274274
RotateControlHandler( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
275-
virtual void onMouseDown( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
275+
virtual void onMouseDown( Control* control, int mouseButtonMask )
276276
{
277277
if( 0 == _dx && 0 == _dy )
278278
{
@@ -292,7 +292,7 @@ struct RotateControlHandler : public NavigationControlHandler
292292
struct ZoomControlHandler : public NavigationControlHandler
293293
{
294294
ZoomControlHandler( osgEarthUtil::EarthManipulator* manip, double dx, double dy ) : _manip( manip ), _dx( dx ), _dy( dy ) { }
295-
virtual void onMouseDown( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
295+
virtual void onMouseDown( Control* control, int mouseButtonMask )
296296
{
297297
_manip->zoom( _dx, _dy );
298298
}
@@ -305,7 +305,7 @@ struct ZoomControlHandler : public NavigationControlHandler
305305
struct HomeControlHandler : public NavigationControlHandler
306306
{
307307
HomeControlHandler( osgEarthUtil::EarthManipulator* manip ) : _manip( manip ) { }
308-
virtual void onMouseDown( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
308+
virtual void onClick( Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
309309
{
310310
_manip->home( ea, aa );
311311
}
@@ -696,7 +696,11 @@ bool NavigationControl::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActi
696696
for( ControlEventHandlerList::const_iterator i = _eventHandlers.begin(); i != _eventHandlers.end(); ++i )
697697
{
698698
NavigationControlHandler* handler = dynamic_cast<NavigationControlHandler*>( i->get() );
699-
if( handler ) handler->onMouseDown( this, ea.getButtonMask(), ea, aa );
699+
if( handler )
700+
{
701+
handler->onMouseDown( this, ea.getButtonMask() );
702+
handler->onClick( this, ea.getButtonMask(), ea, aa );
703+
}
700704
}
701705
}
702706
return Control::handle( ea, aa, cx );

src/plugins/globe/globe_plugin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class FlyToExtentHandler : public osgGA::GUIEventHandler
123123
GlobePlugin* mGlobe;
124124
};
125125

126+
126127
class KeyboardControlHandler : public osgGA::GUIEventHandler
127128
{
128129
public:
@@ -144,7 +145,8 @@ namespace osgEarthUtil
144145
class NavigationControlHandler : public ControlEventHandler
145146
{
146147
public:
147-
virtual void onMouseDown( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { }
148+
virtual void onMouseDown( class Control* control, int mouseButtonMask ) { }
149+
virtual void onClick( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { }
148150
};
149151

150152
class NavigationControl : public ImageControl

0 commit comments

Comments
 (0)