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/layout/DwindleLayout.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/layout/DwindleLayout.hpp') diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 7db9066f..c2d47d88 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -21,8 +21,7 @@ struct SDwindleNodeData { bool splitTop = false; // for preserve_split - Vector2D position; - Vector2D size; + CBox box = {0}; int workspaceID = -1; @@ -34,8 +33,8 @@ struct SDwindleNodeData { // For list lookup bool operator==(const SDwindleNodeData& rhs) const { - return pWindow == rhs.pWindow && workspaceID == rhs.workspaceID && position == rhs.position && size == rhs.size && pParent == rhs.pParent && - children[0] == rhs.children[0] && children[1] == rhs.children[1]; + return pWindow == rhs.pWindow && workspaceID == rhs.workspaceID && box == rhs.box && pParent == rhs.pParent && children[0] == rhs.children[0] && + children[1] == rhs.children[1]; } void recalcSizePosRecursive(bool force = false, bool horizontalOverride = false, bool verticalOverride = false); @@ -96,7 +95,7 @@ struct std::formatter : std::formatter { auto out = ctx.out(); if (!node) return std::format_to(out, "[Node nullptr]"); - std::format_to(out, "[Node {:x}: workspace: {}, pos: {:j2}, size: {:j2}", (uintptr_t)node, node->workspaceID, node->position, node->size); + std::format_to(out, "[Node {:x}: workspace: {}, pos: {:j2}, size: {:j2}", (uintptr_t)node, node->workspaceID, node->box.pos(), node->box.size()); if (!node->isNode && node->pWindow) std::format_to(out, ", window: {:x}", node->pWindow); return std::format_to(out, "]"); -- cgit v1.2.3