aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/GraphBase.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/GraphBase.hpp')
-rw-r--r--include/cru/platform/GraphBase.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cru/platform/GraphBase.hpp b/include/cru/platform/GraphBase.hpp
index 28dab1e6..e476e3cd 100644
--- a/include/cru/platform/GraphBase.hpp
+++ b/include/cru/platform/GraphBase.hpp
@@ -161,6 +161,12 @@ struct Rect final {
constexpr Size GetSize() const { return Size(width, height); }
+ constexpr Rect Expand(const Thickness& thickness) const {
+ return Rect(left - thickness.left, top - thickness.top,
+ width + thickness.GetHorizontalTotal(),
+ height + thickness.GetVerticalTotal());
+ }
+
constexpr Rect Shrink(const Thickness& thickness) const {
return Rect(left + thickness.left, top + thickness.top,
width - thickness.GetHorizontalTotal(),