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

Method CalculateRequisition

src/SFGUI/Scale.cpp:56–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56sf::Vector2f Scale::CalculateRequisition() {
57 auto slider_length = Context::Get().GetEngine().GetProperty<float>( "SliderLength", shared_from_this() );
58 auto slider_width = std::max( 3.f, ( GetOrientation() == Orientation::HORIZONTAL ) ? GetAllocation().size.y : GetAllocation().size.x );
59
60 if( GetOrientation() == Orientation::HORIZONTAL ) {
61 return sf::Vector2f( slider_length * 2.f, slider_width );
62 }
63
64 return sf::Vector2f( slider_width, slider_length * 2.f );
65}
66
67void Scale::HandleMouseButtonEvent( sf::Mouse::Button button, bool press, int x, int y ) {
68 if( button != sf::Mouse::Button::Left ) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected