1 #ifndef TERMOX_WIDGET_BOUNDARY_HPP
2 #define TERMOX_WIDGET_BOUNDARY_HPP
9 template <
typename Number_t>
19 template <
typename Number_t>
23 assert(amount > 0. && std::isfinite(amount));
24 return {Number_t(b.west * amount), Number_t(b.east * amount),
25 Number_t(b.north * amount), Number_t(b.south * amount)};
30 template <
typename Number_t>
31 [[nodiscard]]
auto scroll_west(Boundary<Number_t> b, Number_t amount)
34 assert(amount >= 0. && std::isfinite(amount));
42 template <
typename Number_t>
43 [[nodiscard]]
auto scroll_east(Boundary<Number_t> b, Number_t amount)
46 assert(amount >= 0. && std::isfinite(amount));
54 template <
typename Number_t>
55 [[nodiscard]]
auto scroll_north(Boundary<Number_t> b, Number_t amount)
58 assert(amount >= 0. && std::isfinite(amount));
66 template <
typename Number_t>
67 [[nodiscard]]
auto scroll_south(Boundary<Number_t> b, Number_t amount)
70 assert(amount >= 0. && std::isfinite(amount));
77 template <
typename Number_t>
78 [[nodiscard]]
auto operator-(Boundary<Number_t> a, Boundary<Number_t> b)
81 return {a.west - b.west, a.east - b.east, a.north - b.north,
86 template <
typename Number_t>
87 [[nodiscard]]
auto operator+(Boundary<Number_t> a, Boundary<Number_t> b)
90 return {a.west + b.west, a.east + b.east, a.north + b.north,
Four point Boundary, edges are inclusive.
Definition: boundary.hpp:10