Restructed handling of LAST_POSITION
This commit is contained in:
@@ -1305,19 +1305,11 @@ bool SlideEventHandler::selectSlide(int slideNum,int layerNum)
|
||||
|
||||
OSG_INFO<<"selectSlide("<<slideNum<<","<<layerNum<<")"<<std::endl;
|
||||
|
||||
if (slideNum>=static_cast<int>(_presentationSwitch->getNumChildren()))
|
||||
{
|
||||
slideNum = LAST_POSITION;
|
||||
}
|
||||
|
||||
if (slideNum<=LAST_POSITION && _presentationSwitch->getNumChildren()>0)
|
||||
if (slideNum<0 || slideNum>=static_cast<int>(_presentationSwitch->getNumChildren()))
|
||||
{
|
||||
slideNum = _presentationSwitch->getNumChildren()-1;
|
||||
}
|
||||
|
||||
if (slideNum>=static_cast<int>(_presentationSwitch->getNumChildren())) return false;
|
||||
|
||||
|
||||
osg::Timer_t tick = osg::Timer::instance()->tick();
|
||||
|
||||
if (_firstSlideOrLayerChange)
|
||||
@@ -1408,7 +1400,7 @@ bool SlideEventHandler::selectLayer(int layerNum)
|
||||
layerNum = LAST_POSITION;
|
||||
}
|
||||
|
||||
if (layerNum<=LAST_POSITION && _slideSwitch->getNumChildren()>0)
|
||||
if (layerNum<0)
|
||||
{
|
||||
layerNum = _slideSwitch->getNumChildren()-1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user