11#include "../utility/utility.hpp"
12#include "../macros.hpp"
13#include <hikocpu/hikocpu.hpp>
18hi_export_module(hikogui.geometry : margins);
20hi_export
namespace hi {
inline namespace v1 {
28 using value_type = array_type::value_type;
35 [[nodiscard]]
constexpr margins() noexcept : _v() {}
37 [[nodiscard]]
constexpr margins(
float left,
float bottom,
float right,
float top) noexcept :
38 _v(left, bottom, right, top)
41 [[nodiscard]]
constexpr explicit margins(array_type v) noexcept : _v(v) {}
43 [[nodiscard]]
constexpr explicit operator array_type()
const noexcept
48 [[nodiscard]]
constexpr float left()
const noexcept
53 [[nodiscard]]
constexpr float& left()
noexcept
58 [[nodiscard]]
constexpr float bottom()
const noexcept
63 [[nodiscard]]
constexpr float& bottom()
noexcept
68 [[nodiscard]]
constexpr float right()
const noexcept
73 [[nodiscard]]
constexpr float& right()
noexcept
78 [[nodiscard]]
constexpr float top()
const noexcept
83 [[nodiscard]]
constexpr float& top()
noexcept
89 [[nodiscard]]
constexpr friend float get(
margins const& rhs)
noexcept
91 return get<I>(rhs._v);
94 [[nodiscard]]
constexpr float operator[](
std::size_t i)
const noexcept
107 return margins{max(lhs._v, rhs._v)};
110 [[nodiscard]]
constexpr friend bool operator==(
margins const& lhs,
margins const& rhs)
noexcept
112 return equal(lhs._v, rhs._v);
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Definition simd_intf.hpp:18
The left, bottom, right and top margins.
Definition margins.hpp:25
Definition theme_value.hpp:11