summaryrefslogtreecommitdiff
path: root/ui/uiComponentPlacer.h
blob: b68c4d865804f33df0eaee5cb939c0528df9569e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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