Fixed bug in the flight and drive manipulators where they would uncontrollably

shrink down to a tiny window size when one rezized the window.
This commit is contained in:
Robert Osfield
2003-01-20 11:52:34 +00:00
parent f034ca6d74
commit a889cb8f88
3 changed files with 11 additions and 13 deletions

View File

@@ -257,8 +257,11 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us)
}
}
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
if (ea.getEventType()!=GUIEventAdapter::RESIZE)
{
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
}
computeLocalDataFromCamera();
}

View File

@@ -78,7 +78,10 @@ void FlightManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us)
_velocity = 0.0f;
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
if (ea.getEventType()!=GUIEventAdapter::RESIZE)
{
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
}
computeLocalDataFromCamera();
}

View File

@@ -10,6 +10,8 @@ void KeySwitchCameraManipulator::addCameraManipulator(int key, std::string name,
_manips[key]=std::make_pair(name,osg::ref_ptr<CameraManipulator>(cm));
if(!_current.valid()){
_current=cm;
_current->setNode(_current->getNode());
_current->setCamera(_current->getCamera());
}
}
@@ -39,13 +41,3 @@ bool KeySwitchCameraManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt
return _current->handle(ea,aa);
}
// void KeySwitchCameraManipulator::addCallback(Callback* c)
// {
// _cameraManipChangeCallbacks.addCallback(c);
// }
//
// void KeySwitchCameraManipulator::removeCallback(Callback* c)
// {
// _cameraManipChangeCallbacks.removeCallback(c);
// }