11namespace hi {
inline namespace v1 {
15 using array_type = simd<float, 4>;
16 using value_type = array_type::value_type;
23 [[nodiscard]]
constexpr translate2() noexcept : _v(0.0f, 0.0f, 0.0f, 0.0f) {}
25 [[nodiscard]]
constexpr explicit operator array_type()
const noexcept
36 _v(
static_cast<array_type
>(get<0>(
other)).xy00())
41 _v(
static_cast<array_type
>(get<0>(
other)).xy00())
48 [[nodiscard]]
constexpr explicit translate2(point2
const&
other) noexcept : _v(
static_cast<array_type
>(
other).xy00()) {}
50 [[nodiscard]]
constexpr translate2(
float x,
float y) noexcept : _v(x, y, 0.0f, 0.0f) {}
52 [[nodiscard]]
constexpr float x()
const noexcept
57 [[nodiscard]]
constexpr float y()
const noexcept
62 [[nodiscard]]
constexpr float& x()
noexcept
67 [[nodiscard]]
constexpr float& y()
noexcept
83 x = dst_rectangle.left();
86 x = dst_rectangle.right() - src_rectangle.width();
89 x = dst_rectangle.center() - src_rectangle.width() * 0.5f;
97 y = dst_rectangle.bottom();
100 y = dst_rectangle.top() - src_rectangle.height();
103 y = dst_rectangle.middle() - src_rectangle.height() * 0.5f;
109 return translate2{x - src_rectangle.left(), y - src_rectangle.bottom()};
112 [[nodiscard]]
constexpr friend bool operator==(
translate2 const& lhs,
translate2 const& rhs)
noexcept
114 return equal(lhs._v, rhs._v);
117 [[nodiscard]]
constexpr translate2 operator~() const noexcept
122 [[nodiscard]]
constexpr bool holds_invariant() const noexcept
124 return _v.z() == 0.0f and _v.w() == 0.0f;
127 [[nodiscard]]
friend constexpr translate2 round(translate2
const& rhs)
noexcept
129 return translate2{round(rhs._v)};
#define hi_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:279
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
@ middle
Align to the vertical-middle.
@ bottom
Align to the bottom.
@ right
Align the text to the right side.
@ left
Align the text to the left side.
@ center
Align the text in the center.
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:26
Horizontal/Vertical alignment combination.
Definition alignment.hpp:239
Definition translate2.hpp:13
static constexpr translate2 align(aarectangle src_rectangle, aarectangle dst_rectangle, alignment alignment) noexcept
Align a rectangle within another rectangle.
Definition translate2.hpp:79
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector2.hpp:18