summaryrefslogtreecommitdiff
path: root/src/helpers/Box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Box.cpp')
-rw-r--r--src/helpers/Box.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/helpers/Box.cpp b/src/helpers/Box.cpp
index 55300f5f..29aa81fa 100644
--- a/src/helpers/Box.cpp
+++ b/src/helpers/Box.cpp
@@ -96,6 +96,15 @@ CBox& CBox::scaleFromCenter(double scale) {
return *this;
}
+CBox& CBox::expand(const double& value) {
+ x -= value;
+ y -= value;
+ w += value * 2.0;
+ h += value * 2.0;
+
+ return *this;
+}
+
CBox CBox::roundInternal() {
float newW = x + w - std::floor(x);
float newH = y + h - std::floor(y);
@@ -110,3 +119,7 @@ Vector2D CBox::pos() const {
Vector2D CBox::size() const {
return {w, h};
}
+
+SWindowDecorationExtents CBox::extentsFrom(const CBox& small) {
+ return {{small.x - x, small.y - y}, {w - small.w - (small.x - x), h - small.h - (small.y - y)}};
+}