region: add two point constructor
This commit is contained in:
parent
b50a8289b9
commit
c7a868beac
13
region.cpp
13
region.cpp
@ -38,6 +38,19 @@ util::region<T>::region (point<2,T> _point,
|
|||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
util::region<T>::region (point<2,T> _a,
|
||||||
|
point<2,T> _b):
|
||||||
|
x (_a.x),
|
||||||
|
y (_a.y),
|
||||||
|
w (_b.x - _a.x),
|
||||||
|
h (_b.y - _a.y)
|
||||||
|
{
|
||||||
|
CHECK_GE (_b.x, _a.x);
|
||||||
|
CHECK_GE (_b.y, _a.y);
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
util::region<T>::region (position_type _x,
|
util::region<T>::region (position_type _x,
|
||||||
|
@ -43,6 +43,7 @@ namespace util {
|
|||||||
|
|
||||||
region () = default;
|
region () = default;
|
||||||
region (util::point<2,T>, util::extent<size_type>);
|
region (util::point<2,T>, util::extent<size_type>);
|
||||||
|
region (util::point<2,T>, util::point<2,T>);
|
||||||
region (T _x, T _y, size_type _w, size_type _h);
|
region (T _x, T _y, size_type _w, size_type _h);
|
||||||
|
|
||||||
size_type area (void) const;
|
size_type area (void) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user