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

Method SetAlignment

src/SFGUI/Misc.cpp:7–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace sfg {
6
7void Misc::SetAlignment( const sf::Vector2f& alignment ) {
8 sf::Vector2f old_alignment( m_alignment );
9
10 m_alignment.x = std::max( 0.f, std::min( 1.f, alignment.x ) );
11 m_alignment.y = std::max( 0.f, std::min( 1.f, alignment.y ) );
12
13 if( old_alignment != m_alignment ) {
14 HandleAlignmentChange( old_alignment );
15 }
16}
17
18const sf::Vector2f& Misc::GetAlignment() const {
19 return m_alignment;

Callers 2

RunMethod · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 1

RunMethod · 0.64