25#ifndef TGUI_REL_FLOAT_RECT_HPP
26#define TGUI_REL_FLOAT_RECT_HPP
28#include <TGUI/AbsoluteOrRelativeValue.hpp>
29#include <TGUI/Rect.hpp>
67 [[nodiscard]]
constexpr float getLeft()
const
69 return m_left.getValue();
75 [[nodiscard]]
constexpr float getTop()
const
77 return m_top.getValue();
85 return m_width.getValue();
93 return m_height.getValue();
101 return {m_left.getValue(), m_top.getValue()};
107 [[nodiscard]]
constexpr Vector2f
getSize()
const
109 return {m_width.getValue(), m_height.getValue()};
115 [[nodiscard]]
constexpr FloatRect
getRect()
const
117 return {m_left.getValue(), m_top.getValue(), m_width.getValue(), m_height.getValue()};
126 constexpr void updateParentSize(Vector2f newParentSize)
128 m_left.updateParentSize(newParentSize.
x);
129 m_top.updateParentSize(newParentSize.
y);
130 m_width.updateParentSize(newParentSize.
x);
131 m_height.updateParentSize(newParentSize.
y);
135 AbsoluteOrRelativeValue m_left;
136 AbsoluteOrRelativeValue m_top;
137 AbsoluteOrRelativeValue m_width;
138 AbsoluteOrRelativeValue m_height;
Class to store the a value that is either a constant or a ratio.
Definition AbsoluteOrRelativeValue.hpp:44
T y
Y coordinate of the vector.
Definition Vector2.hpp:136
T x
X coordinate of the vector.
Definition Vector2.hpp:135
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37
constexpr RelFloatRect()=default
Default constructor.
constexpr Vector2f getSize() const
Returns the size of the rect as an absolute value.
Definition RelFloatRect.hpp:107
constexpr float getTop() const
Returns the top position of the rect as an absolute value.
Definition RelFloatRect.hpp:75
constexpr FloatRect getRect() const
Returns the the rectangle as an absolute value.
Definition RelFloatRect.hpp:115
constexpr Vector2f getPosition() const
Returns the size of the rect as an absolute value.
Definition RelFloatRect.hpp:99
constexpr float getLeft() const
Returns the left position of the rect as an absolute value.
Definition RelFloatRect.hpp:67
constexpr float getWidth() const
Returns the width of the rect as an absolute value.
Definition RelFloatRect.hpp:83
constexpr RelFloatRect(AbsoluteOrRelativeValue left, AbsoluteOrRelativeValue top, AbsoluteOrRelativeValue width, AbsoluteOrRelativeValue height)
Constructs the rectangle from its position and size.
Definition RelFloatRect.hpp:53
constexpr float getHeight() const
Returns the height of the rect as an absolute value.
Definition RelFloatRect.hpp:91