7#include "box_constraints.hpp"
8#include "../geometry/module.hpp"
9#include "../utility/module.hpp"
13namespace hi {
inline namespace v1 {
17 std::optional<float> baseline = {};
18 std::optional<float> centerline = {};
25 [[nodiscard]]
constexpr friend bool operator==(
box_shape const&,
box_shape const&)
noexcept =
default;
27 constexpr box_shape(
extent2 size) noexcept : rectangle(size), baseline(), centerline()
36 float baseline_adjustment) noexcept :
38 baseline(make_guideline(
39 constraints.alignment.vertical(),
42 baseline_adjustment)),
43 centerline(make_guideline(
44 constraints.alignment.horizontal(),
54 hi_axiom(rectangle.size() >= constraints.minimum);
58 [[nodiscard]]
constexpr float x()
const noexcept
63 [[nodiscard]]
constexpr float y()
const noexcept
68 [[nodiscard]]
constexpr extent2 size()
const noexcept
70 return rectangle.size();
73 [[nodiscard]]
constexpr float width()
const noexcept
75 return rectangle.width();
78 [[nodiscard]]
constexpr float height()
const noexcept
80 return rectangle.height();
83 [[nodiscard]]
constexpr bool holds_invariant()
const noexcept
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
constexpr bool is_integral_value(T const &rhs) noexcept
Check if a value is integral.
Definition value_traits.hpp:18
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:27
2D constraints.
Definition box_constraints.hpp:22
Definition box_shape.hpp:15
Tag used for special functions or constructions to do a override compared to another function of the ...
Definition utility.hpp:235