25#ifndef TGUI_OUTLINE_HPP
26#define TGUI_OUTLINE_HPP
28#include <TGUI/AbsoluteOrRelativeValue.hpp>
29#include <TGUI/Vector2.hpp>
58 template <
typename T,
typename =
typename std::enable_if_t<std::is_arithmetic_v<T>, T>>
93 m_left{leftBorderWidth},
94 m_top{topBorderHeight},
95 m_right{rightBorderWidth},
96 m_bottom{bottomBorderHeight}
107 return m_left.getValue();
115 [[nodiscard]]
constexpr float getTop()
const
117 return m_top.getValue();
127 return m_right.getValue();
137 return m_bottom.getValue();
191 return !(*
this == outline);
254 constexpr void updateParentSize(Vector2f newParentSize)
256 m_left.updateParentSize(newParentSize.
x);
257 m_top.updateParentSize(newParentSize.
y);
258 m_right.updateParentSize(newParentSize.
x);
259 m_bottom.updateParentSize(newParentSize.
y);
268 [[nodiscard]] String toString()
const
270 return U
"(" + m_left.toString() + U
", " + m_top.toString() + U
", " + m_right.toString() + U
", " + m_bottom.toString()
277 AbsoluteOrRelativeValue m_left = 0;
278 AbsoluteOrRelativeValue m_top = 0;
279 AbsoluteOrRelativeValue m_right = 0;
280 AbsoluteOrRelativeValue m_bottom = 0;
Class to store the a value that is either a constant or a ratio.
Definition AbsoluteOrRelativeValue.hpp:44
Definition Outline.hpp:38
constexpr Outline operator+(const Outline &other) const
Adds two outlines together (e.g. to add padding and borders).
Definition Outline.hpp:199
constexpr bool operator!=(const Outline &outline) const
Compares two outlines.
Definition Outline.hpp:189
constexpr Outline & operator-=(const Outline &other)
Subtracts an outline from this instance.
Definition Outline.hpp:239
constexpr Outline(AbsoluteOrRelativeValue leftBorderWidth, AbsoluteOrRelativeValue topBorderHeight, AbsoluteOrRelativeValue rightBorderWidth, AbsoluteOrRelativeValue bottomBorderHeight)
Constructor that initializes the outline.
Definition Outline.hpp:89
constexpr float getTop() const
Returnes the height of the top outline.
Definition Outline.hpp:115
constexpr Outline(AbsoluteOrRelativeValue width, AbsoluteOrRelativeValue height)
Constructor that initializes the outline.
Definition Outline.hpp:73
constexpr Vector2f getOffset() const
Returnes the width of the left and top outlines.
Definition Outline.hpp:144
constexpr float getRight() const
Returnes the width of the right outline.
Definition Outline.hpp:125
constexpr float getLeftPlusRight() const
Returnes the width of the left and right outlines combined.
Definition Outline.hpp:154
constexpr Outline & operator+=(const Outline &other)
Adds an outline to this instance (e.g. to add padding and borders).
Definition Outline.hpp:225
constexpr Outline(T size)
Constructor that initializes the outline.
Definition Outline.hpp:59
constexpr float getLeft() const
Returnes the width of the left outline.
Definition Outline.hpp:105
constexpr Outline(AbsoluteOrRelativeValue size=0)
Default constructor that initializes the outline.
Definition Outline.hpp:45
constexpr bool operator==(const Outline &outline) const
Compares two outlines.
Definition Outline.hpp:176
constexpr float getTopPlusBottom() const
Returnes the height of the top and bottom outlines combined.
Definition Outline.hpp:164
constexpr float getBottom() const
Returnes the height of the bottom outline.
Definition Outline.hpp:135
constexpr Outline operator-(const Outline &other) const
Subtracts two outlines from each other.
Definition Outline.hpp:212
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