From 931927de29256a46004cd6f71fdf45ed76470b73 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 4 Nov 2023 21:45:34 +0000 Subject: dwindle: move to CBox for expressing nodes --- src/helpers/Box.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/helpers/Box.hpp') diff --git a/src/helpers/Box.hpp b/src/helpers/Box.hpp index 7a8aa939..a5f24d7b 100644 --- a/src/helpers/Box.hpp +++ b/src/helpers/Box.hpp @@ -32,6 +32,13 @@ class CBox { h = d; } + CBox(const Vector2D& pos, const Vector2D& size) { + x = pos.x; + y = pos.y; + w = size.x; + h = size.y; + } + wlr_box wlr(); wlr_box* pWlr(); @@ -45,6 +52,8 @@ class CBox { CBox& addExtents(const SWindowDecorationExtents& e); Vector2D middle() const; + Vector2D pos() const; + Vector2D size() const; bool containsPoint(const Vector2D& vec) const; bool empty() const; @@ -59,6 +68,11 @@ class CBox { double height; }; + // + bool operator==(const CBox& rhs) const { + return x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h; + } + private: CBox roundInternal(); -- cgit v1.2.3