diff --git a/region.cpp b/region.cpp index 5767270d..edba9e54 100644 --- a/region.cpp +++ b/region.cpp @@ -307,6 +307,15 @@ util::region::operator+ (vector<2,T> rhs) const } +//----------------------------------------------------------------------------- +template +util::region +util::region::operator- (vector<2,T> rhs) const +{ + return { x - rhs.x, y - rhs.y, w, h }; +} + + /////////////////////////////////////////////////////////////////////////////// template bool diff --git a/region.hpp b/region.hpp index 3bf839f9..ffdbcfdf 100644 --- a/region.hpp +++ b/region.hpp @@ -83,6 +83,7 @@ namespace util { // arithmetic operators region operator+ (vector<2,T>) const; + region operator- (vector<2,T>) const; // Logical comparison operators bool operator ==(const region& rhs) const;