region: add vector subtraction operator

This commit is contained in:
Danny Robson 2015-02-20 16:06:46 +11:00
parent 43fcd59d80
commit 0a153e8e12
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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;