25#ifndef TGUI_REL_FLOAT_RECT_HPP
26#define TGUI_REL_FLOAT_RECT_HPP
28#include <TGUI/AbsoluteOrRelativeValue.hpp>
29#include <TGUI/Rect.hpp>
33TGUI_MODULE_EXPORT
namespace tgui
65 TGUI_NODISCARD
constexpr float getLeft()
const
67 return m_left.getValue();
73 TGUI_NODISCARD
constexpr float getTop()
const
75 return m_top.getValue();
81 TGUI_NODISCARD
constexpr float getWidth()
const
83 return m_width.getValue();
91 return m_height.getValue();
99 return {m_left.getValue(), m_top.getValue()};
107 return {m_width.getValue(), m_height.getValue()};
115 return {m_left.getValue(), m_top.getValue(), m_width.getValue(), m_height.getValue()};
124 constexpr void updateParentSize(
Vector2f newParentSize)
126 m_left.updateParentSize(newParentSize.
x);
127 m_top.updateParentSize(newParentSize.
y);
128 m_width.updateParentSize(newParentSize.
x);
129 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:45
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:38
FloatRect that can contain absolute values or values relative to the parent size.
Definition RelFloatRect.hpp:39
constexpr RelFloatRect()=default
Default constructor.
constexpr Vector2f getSize() const
Returns the size of the rect as an absolute value.
Definition RelFloatRect.hpp:105
constexpr float getTop() const
Returns the top position of the rect as an absolute value.
Definition RelFloatRect.hpp:73
constexpr FloatRect getRect() const
Returns the the rectangle as an absolute value.
Definition RelFloatRect.hpp:113
constexpr Vector2f getPosition() const
Returns the size of the rect as an absolute value.
Definition RelFloatRect.hpp:97
constexpr float getLeft() const
Returns the left position of the rect as an absolute value.
Definition RelFloatRect.hpp:65
constexpr float getWidth() const
Returns the width of the rect as an absolute value.
Definition RelFloatRect.hpp:81
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:89