19template <
typename Dim>
25 return (
first + last) / 2;
46 template <
typename Dim>
75 using AlignBase::AlignBase;
125 using AlignBase::AlignBase;
189 .dy =
v().resolveOffset(
outer.yMin(),
outer.yMax(),
Combines horizontal and vertical alignment.
constexpr Alignment(HAlign h, VAlign v)
constexpr HAlign h() const
Offset resolveOffset(const Box &outer, const Box &inner) const
constexpr Alignment(VAlign v)
bool operator!=(Alignment other) const
Alignment shiftBy(int16_t dx, int16_t dy)
constexpr VAlign v() const
constexpr Alignment(HAlign h)
bool operator==(Alignment other) const
Axis-aligned integer rectangle.
constexpr HAlign toCenter() const
constexpr HAlign toLeft() const
constexpr HAlign shiftBy(int16_t shift_by) const
constexpr HAlign toRight() const
constexpr HAlign toOrigin() const
constexpr VAlign shiftBy(int16_t shift_by) const
constexpr VAlign toBottom() const
constexpr VAlign toMiddle() const
constexpr VAlign toBaseline() const
constexpr VAlign toTop() const
Dim resolveOffset(Dim first_outer, Dim last_outer, Dim first_inner, Dim last_inner) const
bool operator!=(AlignBase other) const
constexpr int16_t shift() const
constexpr AlignBase(Anchor dst, Anchor src, int16_t shift)
constexpr Anchor dst() const
constexpr Anchor src() const
bool operator==(AlignBase other) const
Dim resolveAnchor(Anchor anchor, Dim first, Dim last)
Defines 140 opaque HTML named colors.
static constexpr HAlign kCenter
Center-to-center with no shift.
static constexpr HAlign kLeft
Left-to-left with no shift.
static constexpr Alignment kNoAlign
Absolute alignment (no repositioning).
static constexpr HAlign kRight
Right-to-right with no shift.
static constexpr VAlign kMiddle
Middle-to-middle with no shift.
Anchor
Anchor point used for alignment.
static constexpr VAlign kBaseline
Baseline-to-baseline with no shift.
constexpr Alignment operator|(HAlign h, VAlign v)
Combine horizontal and vertical alignments.
static constexpr VAlign kBottom
Bottom-to-bottom with no shift.
static constexpr VAlign kTop
Top-to-top with no shift.
static constexpr HAlign kOrigin
Origin-to-origin with no shift.