HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Friends
hi::v1::box_constraints Struct Reference

#include <hikogui/layout/box_constraints.hpp>

Public Member Functions

constexpr box_constraints (box_constraints const &) noexcept=default
 
constexpr box_constraints (box_constraints &&) noexcept=default
 
constexpr box_constraintsoperator= (box_constraints const &) noexcept=default
 
constexpr box_constraintsoperator= (box_constraints &&) noexcept=default
 
constexpr box_constraints (extent2 minimum, extent2 preferred, extent2 maximum, hi::alignment alignment=hi::alignment{}, hi::margins margins=hi::margins{}) noexcept
 
constexpr box_constraints constrain (extent2 new_minimum, extent2 new_maximum) const noexcept
 
constexpr box_constraintsoperator+= (extent2 const &rhs) noexcept
 
constexpr box_constraints operator+ (extent2 const &rhs) const noexcept
 
constexpr bool holds_invariant () const noexcept
 

Data Fields

extent2 minimum = {}
 
extent2 preferred = {}
 
extent2 maximum = {}
 
hi::margins margins = {}
 
hi::alignment alignment = hi::alignment{}
 

Friends

constexpr friend bool operator== (box_constraints const &, box_constraints const &) noexcept=default
 
constexpr box_constraints max (box_constraints const &lhs, extent2 const &rhs) noexcept
 
constexpr box_constraints max (box_constraints const &lhs, box_constraints const &rhs) noexcept
 Makes a constraint that encompasses both given constraints.
 
template<std::convertible_to< box_constraints >... Args>
constexpr box_constraints max (box_constraints const &first, box_constraints const &second, box_constraints const &third, Args const &...args) noexcept
 

Detailed Description

2D constraints.

This type holds multiple possible sizes that an 2D object may be. We need multiple sizes in case there is a non-linear relation between the width and height of an object.

Friends And Related Symbol Documentation

◆ max

constexpr box_constraints max ( box_constraints const & lhs,
box_constraints const & rhs )
friend

Makes a constraint that encompasses both given constraints.

Note
The alignment is selected from the left-hand-side.
Parameters
lhsThe left hand side box constraints.
rhsThe right hand side box constraints.
Returns
A box constraints that encompasses both given constraints.

The documentation for this struct was generated from the following file: