| 567 | } |
| 568 | |
| 569 | sf::Vector2f Widget::GetAbsolutePosition() const { |
| 570 | // If no parent, allocation's position is absolute position. |
| 571 | PtrConst parent( m_parent.lock() ); |
| 572 | |
| 573 | if( !parent ) { |
| 574 | return sf::Vector2f( GetAllocation().position.x, GetAllocation().position.y ); |
| 575 | } |
| 576 | |
| 577 | // Get parent's absolute position and add own rel. position to it. |
| 578 | sf::Vector2f parent_position( parent->GetAbsolutePosition() ); |
| 579 | |
| 580 | return sf::Vector2f( |
| 581 | parent_position.x + GetAllocation().position.x, |
| 582 | parent_position.y + GetAllocation().position.y |
| 583 | ); |
| 584 | } |
| 585 | |
| 586 | void Widget::UpdateDrawablePosition() const { |
| 587 | if( m_drawable ) { |
no outgoing calls
no test coverage detected