diff options
Diffstat (limited to 'src/Geometry.h')
-rw-r--r-- | src/Geometry.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Geometry.h b/src/Geometry.h index 01af92969..a6e49ad5b 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -129,6 +129,10 @@ public: return PRectangle(left + delta, top + delta, right - delta, bottom - delta); } + constexpr PRectangle Inset(Point delta) const noexcept { + return PRectangle(left + delta.x, top + delta.y, right - delta.x, bottom - delta.y); + } + constexpr Point Centre() const noexcept { return Point((left + right) / 2, (top + bottom) / 2); } |