11#include "../utility/utility.hpp"
12#include "../macros.hpp"
18hi_export_module(hikogui.geometry : alignment);
20hi_export
namespace hi {
inline namespace v1 {
238 return resolve(
mirror(rhs, left_to_right), left_to_right);
255 _value((std::to_underlying(v) << 4) | std::to_underlying(t))
257 hi_axiom(std::to_underlying(v) <= 0xf);
258 hi_axiom(std::to_underlying(t) <= 0xf);
262 _value((std::to_underlying(v) << 4) | std::to_underlying(h))
264 hi_axiom(std::to_underlying(v) <= 0xf);
265 hi_axiom(std::to_underlying(h) <= 0xf);
347 return lhs.horizontal() == rhs;
352 return lhs == rhs.horizontal();
357 return lhs.vertical() == rhs;
362 return lhs == rhs.vertical();
367 return alignment{mirror(rhs.horizontal()), rhs.vertical()};
372 return alignment{mirror(rhs.horizontal(), left_to_right), rhs.vertical()};
377 return alignment{resolve(rhs.horizontal(), left_to_right), rhs.vertical()};
382 return alignment{resolve_mirror(rhs.horizontal(), left_to_right), rhs.vertical()};
vertical_alignment
Vertical alignment.
Definition alignment.hpp:25
horizontal_alignment
Horizontal alignment.
Definition alignment.hpp:102
constexpr std::optional< float > make_guideline(vertical_alignment alignment, float bottom, float top, float guideline_width)
Create a guideline between two points.
Definition alignment.hpp:61
@ 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.
@ flush
Align the text naturally based on the writing direction of each paragraph.
@ justified
Stretch the text to be flush to both sides.
@ center
Align the text in the center.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr horizontal_alignment mirror(horizontal_alignment const &rhs) noexcept
Mirror the horizontal alignment.
Definition alignment.hpp:205
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Horizontal/Vertical alignment combination.
Definition alignment.hpp:244