| 54 | } |
| 55 | |
| 56 | sf::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 | |
| 67 | void Scale::HandleMouseButtonEvent( sf::Mouse::Button button, bool press, int x, int y ) { |
| 68 | if( button != sf::Mouse::Button::Left ) { |
nothing calls this directly
no outgoing calls
no test coverage detected