mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 09:48:51 +01:00
Fix scrollingPeriod_ in case of incorrect initialisation or update.
This commit is contained in:
parent
cbcfc498a3
commit
2b2b6bc7ce
@ -78,7 +78,7 @@ ScrollingList::ScrollingList(const ScrollingList ©)
|
|||||||
, selectedOffsetIndex_(copy.selectedOffsetIndex_)
|
, selectedOffsetIndex_(copy.selectedOffsetIndex_)
|
||||||
, scrollAcceleration_(copy.scrollAcceleration_)
|
, scrollAcceleration_(copy.scrollAcceleration_)
|
||||||
, startScrollTime_(copy.startScrollTime_)
|
, startScrollTime_(copy.startScrollTime_)
|
||||||
, scrollPeriod_(0)
|
, scrollPeriod_(copy.startScrollTime_)
|
||||||
, config_(copy.config_)
|
, config_(copy.config_)
|
||||||
, scaleX_(copy.scaleX_)
|
, scaleX_(copy.scaleX_)
|
||||||
, scaleY_(copy.scaleY_)
|
, scaleY_(copy.scaleY_)
|
||||||
@ -367,6 +367,14 @@ void ScrollingList::triggerHighlightExitEvent( int menuIndex )
|
|||||||
|
|
||||||
void ScrollingList::update(float dt)
|
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);
|
Component::update(dt);
|
||||||
|
|
||||||
if(components_.size() == 0) return;
|
if(components_.size() == 0) return;
|
||||||
|
|||||||
@ -313,7 +313,6 @@ void RetroFE::run()
|
|||||||
case RETROFE_ENTER:
|
case RETROFE_ENTER:
|
||||||
if(currentPage_->isIdle())
|
if(currentPage_->isIdle())
|
||||||
{
|
{
|
||||||
currentPage_->resetScrollPeriod();
|
|
||||||
state = RETROFE_IDLE;
|
state = RETROFE_IDLE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user