diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index f2a5abc..ceb938b 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -78,7 +78,7 @@ ScrollingList::ScrollingList(const ScrollingList ©) , selectedOffsetIndex_(copy.selectedOffsetIndex_) , scrollAcceleration_(copy.scrollAcceleration_) , startScrollTime_(copy.startScrollTime_) - , scrollPeriod_(0) + , scrollPeriod_(copy.startScrollTime_) , config_(copy.config_) , scaleX_(copy.scaleX_) , scaleY_(copy.scaleY_) @@ -367,6 +367,14 @@ void ScrollingList::triggerHighlightExitEvent( int menuIndex ) void ScrollingList::update(float dt) { + + // Check if scrollPeriod_ has been properly initialised already or if something went wrong + // while updating the scrollPeriod_ + if(scrollPeriod_ < scrollAcceleration_) + { + scrollPeriod_ = startScrollTime_; + } + Component::update(dt); if(components_.size() == 0) return; diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index f2b59aa..6bcf343 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -313,7 +313,6 @@ void RetroFE::run() case RETROFE_ENTER: if(currentPage_->isIdle()) { - currentPage_->resetScrollPeriod(); state = RETROFE_IDLE; } break;