13 using UNIT_TYPE = NUMBER;
19 shift_type()
noexcept { this->Δx = (UNIT_TYPE)0; this->Δy = (UNIT_TYPE)0; }
21 shift_type(nullptr_t)
noexcept { this->Δx = (UNIT_TYPE)0; this->Δy = (UNIT_TYPE)0; }
22 template < prototype_number X, prototype_number Y >
23 shift_type(X x, Y y)
noexcept { this->Δx = (UNIT_TYPE) x; this->Δy = (UNIT_TYPE) y; }
24 template < prototype_sequence2 SEQUENCE >
25 shift_type(
const SEQUENCE & s) { this->Δx = (UNIT_TYPE)s.x; this->Δy = (UNIT_TYPE)s.y; }
30 shift_type operator -()
const {
return { -this->Δx, -this->Δy }; }
33 shift_type operator +(
const shift_type & shift)
const {
return { this->Δx + shift.Δx, this->Δy + shift.Δy }; }
34 shift_type operator -(
const shift_type & shift)
const {
return { this->Δx - shift.Δx, this->Δy - shift.Δy }; }
37 template < prototype_sequence2 SEQUENCE >
38 inline SEQUENCE & operator()(SEQUENCE & s)
const noexcept
42 s.x = (::std::decay_t<
decltype(s.x)>)(s.x + this->Δx);
44 s.y = (::std::decay_t<
decltype(s.y)>)(s.y + this->Δy);
64 template < prototype_rectangle RECTANGLE >
65 inline RECTANGLE & operator()(RECTANGLE & rectangle)
const noexcept
68 rectangle.left = (::std::decay_t<
decltype(rectangle.left)>)(rectangle.left + this->Δx);
70 rectangle.top = (::std::decay_t<
decltype(rectangle.top)>)(rectangle.top + this->Δy);
72 rectangle.right = (::std::decay_t<
decltype(rectangle.right)>)(rectangle.right + this->Δx);
74 rectangle.bottom = (::std::decay_t<
decltype(rectangle.bottom)>)(rectangle.bottom + this->Δy);
81 template < prototype_po
int POINT >
82 inline POINT get(
const POINT & point)
const noexcept {
return { (
decltype(point.x))(point.x + this->Δx), (
decltype(point.y))(point.y + this->Δy) }; }
84 template < prototype_size SIZE >
85 inline SIZE get(
const SIZE & size)
const noexcept {
return { (
decltype(size.cx))(size.cx + this->Δx), (
decltype(size.cy))(size.cy + this->Δy) }; }
87 template < prototype_rectangle RECTANGLE >
88 inline RECTANGLE get(
const RECTANGLE & rectangle)
const noexcept {
return { (
decltype(rectangle.left))(rectangle.left + this->Δx), (
decltype(rectangle.top))(rectangle.top + this->Δy), (
decltype(rectangle.right))(rectangle.right + this->Δx), (
decltype(rectangle.bottom))(rectangle.bottom + this->Δy) }; }