From 723870337f299d4c80aa0048144f3a1ca1c885bd Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:30:39 +0000 Subject: layout: rethonk layouts from the ground up (#12890) Rewrites layouts to be much smaller, and deal with much less annoying BS. Improves the overall architecture, unifies handling of pseudotiling, and various other improvements. --- src/helpers/math/Direction.cpp | 0 src/helpers/math/Direction.hpp | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/helpers/math/Direction.cpp create mode 100644 src/helpers/math/Direction.hpp (limited to 'src/helpers/math') diff --git a/src/helpers/math/Direction.cpp b/src/helpers/math/Direction.cpp new file mode 100644 index 00000000..e69de29b diff --git a/src/helpers/math/Direction.hpp b/src/helpers/math/Direction.hpp new file mode 100644 index 00000000..9905db4f --- /dev/null +++ b/src/helpers/math/Direction.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include + +namespace Math { + enum eDirection : int8_t { + DIRECTION_DEFAULT = -1, + DIRECTION_UP, + DIRECTION_RIGHT, + DIRECTION_DOWN, + DIRECTION_LEFT + }; + + inline eDirection fromChar(char x) { + switch (x) { + case 'r': return DIRECTION_RIGHT; + case 'l': return DIRECTION_LEFT; + case 't': + case 'u': return DIRECTION_UP; + case 'b': + case 'd': return DIRECTION_DOWN; + default: return DIRECTION_DEFAULT; + } + } + + inline const char* toString(eDirection d) { + switch (d) { + case DIRECTION_UP: return "up"; + case DIRECTION_DOWN: return "down"; + case DIRECTION_LEFT: return "left"; + case DIRECTION_RIGHT: return "right"; + default: return "default"; + } + } +}; \ No newline at end of file -- cgit v1.2.3