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

Method HandleUpdate

src/SFGUI/Spinner.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void Spinner::HandleUpdate( float seconds ) {
54 float duration( Context::Get().GetEngine().GetProperty<float>( "CycleDuration", shared_from_this() ) );
55 unsigned int steps( Context::Get().GetEngine().GetProperty<unsigned int>( "Steps", shared_from_this() ) );
56
57 m_elapsed_time += seconds;
58
59 if( m_started && ( m_elapsed_time > ( ( duration / static_cast<float>( steps ) ) / 1000.f ) ) ) {
60 m_elapsed_time = 0.f;
61
62 m_stage = ( m_stage + 1 ) % steps;
63
64 Invalidate();
65 }
66}
67
68unsigned int Spinner::GetStage() const {
69 return m_stage;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected