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

Method SetValue

src/SFGUI/Adjustment.cpp:37–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void Adjustment::SetValue( float new_value ) {
38 auto old_value = m_value;
39 m_value = new_value;
40
41 // Clamp value within limits
42 if( m_value < m_lower ) {
43 m_value = m_lower;
44 }
45 else if( m_value + m_page_size > m_upper ) {
46 m_value = m_upper - m_page_size;
47 }
48
49 if( m_value != old_value ) {
50 GetSignals().Emit( OnChange );
51 }
52}
53
54float Adjustment::GetLower() const {
55 return m_lower;

Callers

nothing calls this directly

Calls 1

EmitMethod · 0.80

Tested by

no test coverage detected