region: add far corner query

This commit is contained in:
Danny Robson 2015-02-17 16:24:33 +11:00
parent 8ea1a04f57
commit e1ebacb16a
2 changed files with 10 additions and 0 deletions

View File

@ -109,6 +109,15 @@ util::region<T>::base (void) const
} }
//-----------------------------------------------------------------------------
template <typename T>
util::point<2,T>
util::region<T>::far (void) const
{
return { x + w, y + h };
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename T> template <typename T>
util::point<2,T> util::point<2,T>

View File

@ -54,6 +54,7 @@ namespace util {
bool empty (void) const; bool empty (void) const;
point<2,T> base (void) const; point<2,T> base (void) const;
point<2,T> far (void) const;
point<2,T> centre (void) const; point<2,T> centre (void) const;
point<2,T> closest (point<2,T>) const; point<2,T> closest (point<2,T>) const;