| 274 | } |
| 275 | |
| 276 | void Widget::SetPosition( const sf::Vector2f& position ) { |
| 277 | sf::FloatRect allocation( GetAllocation() ); |
| 278 | |
| 279 | // Make sure allocation is pixel-aligned. |
| 280 | m_allocation.position.x = std::floor( position.x + .5f ); |
| 281 | m_allocation.position.y = std::floor( position.y + .5f ); |
| 282 | |
| 283 | if( ( allocation.position.y != m_allocation.position.y ) || ( allocation.position.x != m_allocation.position.x ) ) { |
| 284 | HandlePositionChange(); |
| 285 | HandleAbsolutePositionChange(); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | void Widget::HandleEvent( const sf::Event& event ) { |
| 290 | if( !IsGloballyVisible() ) { |
no outgoing calls