@@ -45,6 +45,62 @@ struct TPoint {
4545 return p.x != x || p.y != y;
4646 }
4747
48+ template <class U >
49+ inline TPoint operator +=(const TPoint<U>& p) {
50+ x += static_cast <Type>(p.x );
51+ y += static_cast <Type>(p.y );
52+ return *this ;
53+ }
54+
55+ template <class U >
56+ inline TPoint operator +=(const TSize<U>& s) {
57+ x += static_cast <Type>(s.width );
58+ y += static_cast <Type>(s.height );
59+ return *this ;
60+ }
61+
62+ template <class U >
63+ inline TPoint operator -=(const TPoint<U>& p) {
64+ x -= static_cast <Type>(p.x );
65+ y -= static_cast <Type>(p.y );
66+ return *this ;
67+ }
68+
69+ template <class U >
70+ inline TPoint operator -=(const TSize<U>& s) {
71+ x -= static_cast <Type>(s.width );
72+ y -= static_cast <Type>(s.height );
73+ return *this ;
74+ }
75+
76+ template <class U >
77+ inline TPoint operator *=(const TPoint<U>& p) {
78+ x *= static_cast <Type>(p.x );
79+ y *= static_cast <Type>(p.y );
80+ return *this ;
81+ }
82+
83+ template <class U >
84+ inline TPoint operator *=(const TSize<U>& s) {
85+ x *= static_cast <Type>(s.width );
86+ y *= static_cast <Type>(s.height );
87+ return *this ;
88+ }
89+
90+ template <class U >
91+ inline TPoint operator /=(const TPoint<U>& p) {
92+ x /= static_cast <Type>(p.x );
93+ y /= static_cast <Type>(p.y );
94+ return *this ;
95+ }
96+
97+ template <class U >
98+ inline TPoint operator /=(const TSize<U>& s) {
99+ x /= static_cast <Type>(s.width );
100+ y /= static_cast <Type>(s.height );
101+ return *this ;
102+ }
103+
48104 constexpr TPoint operator -() const { return {-x, -y}; }
49105
50106 constexpr TPoint operator +(const TPoint& p) const {
0 commit comments