-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathAlignment.hpp
More file actions
50 lines (36 loc) · 919 Bytes
/
Alignment.hpp
File metadata and controls
50 lines (36 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <SFGUI/Bin.hpp>
#include <SFGUI/Misc.hpp>
#include <memory>
namespace sfg {
/** Alignment.
*/
class SFGUI_API Alignment : public Bin, public Misc {
public:
typedef std::shared_ptr<Alignment> Ptr; //!< Shared pointer.
typedef std::shared_ptr<const Alignment> PtrConst; //!< Shared pointer.
/** Create alignment.
* @return Alignment.
*/
static Ptr Create();
const std::string& GetName() const override;
/** Set scale
* @param scale Scale (0..1 for x and y).
*/
void SetScale( const sf::Vector2f& scale );
/** Get scale.
* @return Scale.
*/
const sf::Vector2f& GetScale() const;
protected:
/** Ctor.
*/
Alignment();
sf::Vector2f CalculateRequisition() override;
private:
void HandleSizeChange() override;
void HandleAlignmentChange( const Misc::Alignment& old_alignment ) override;
void UpdateChild();
sf::Vector2f m_scale;
};
}