region: add vector subtraction operator
This commit is contained in:
parent
43fcd59d80
commit
0a153e8e12
@ -307,6 +307,15 @@ util::region<T>::operator+ (vector<2,T> rhs) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
util::region<T>
|
||||||
|
util::region<T>::operator- (vector<2,T> rhs) const
|
||||||
|
{
|
||||||
|
return { x - rhs.x, y - rhs.y, w, h };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool
|
bool
|
||||||
|
@ -83,6 +83,7 @@ namespace util {
|
|||||||
|
|
||||||
// arithmetic operators
|
// arithmetic operators
|
||||||
region operator+ (vector<2,T>) const;
|
region operator+ (vector<2,T>) const;
|
||||||
|
region operator- (vector<2,T>) const;
|
||||||
|
|
||||||
// Logical comparison operators
|
// Logical comparison operators
|
||||||
bool operator ==(const region<T>& rhs) const;
|
bool operator ==(const region<T>& rhs) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user