summaryrefslogtreecommitdiff
path: root/ui/uiComponentPlacer.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/uiComponentPlacer.h')
-rw-r--r--ui/uiComponentPlacer.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/uiComponentPlacer.h b/ui/uiComponentPlacer.h
new file mode 100644
index 0000000..b68c4d8
--- /dev/null
+++ b/ui/uiComponentPlacer.h
@@ -0,0 +1,22 @@
+#ifndef UICOMPONENTPLACER_H
+#define UICOMPONENTPLACER_H
+
+#include <glm/glm.hpp>
+
+class UIComponentPlacer {
+public:
+ UIComponentPlacer(glm::vec2 padding, float spacing, glm::length_t axis = 0);
+
+ glm::vec2 next(glm::vec2 size);
+ glm::vec2 getLimit() const;
+
+private:
+ const glm::vec2 padding;
+ const float spacing;
+ const glm::length_t axis;
+
+ float current {};
+ float max {};
+};
+
+#endif