MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleUpdate

Method HandleUpdate

src/SFGUI/Notebook.cpp:541–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541void Notebook::HandleUpdate( float seconds ) {
542 Container::HandleUpdate( seconds );
543
544 float scroll_speed( Context::Get().GetEngine().GetProperty<float>( "ScrollSpeed", shared_from_this() ) );
545
546 m_elapsed_time += seconds;
547
548 if( m_elapsed_time < ( 1.f / scroll_speed ) ) {
549 return;
550 }
551
552 m_elapsed_time -= ( 1.f / scroll_speed );
553
554 if( IsScrollingForward() ) {
555 m_first_tab = std::min( m_first_tab + 1, GetPageCount() - GetDisplayedTabCount() );
556 RecalculateSize();
557 }
558 else if( IsScrollingBackward() ) {
559 m_first_tab = std::max( m_first_tab - 1, 0 );
560 RecalculateSize();
561 }
562}
563
564void Notebook::RecalculateSize() {
565 if( !IsGloballyVisible() ) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected