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

Method SetPosition

src/SFGUI/Widget.cpp:276–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276void 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
289void Widget::HandleEvent( const sf::Event& event ) {
290 if( !IsGloballyVisible() ) {

Callers 7

HandleStateChangeMethod · 0.45
UpdateMethod · 0.45
RunMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by 1

RunMethod · 0.36