32 lines
728 B
C++
32 lines
728 B
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "ui/UIAlignableElement.hpp"
|
|
|
|
namespace Dawn {
|
|
enum class UISubAlignment {
|
|
START,
|
|
MIDDLE,
|
|
END
|
|
};
|
|
|
|
class UISubAlignableElement : public UIAlignableElement {
|
|
protected:
|
|
glm::vec2 subAlignedPosition;
|
|
|
|
public:
|
|
Event<glm::vec2> eventSubAlignmentUpdated;
|
|
|
|
enum UISubAlignment subAlignX = UISubAlignment::START;
|
|
enum UISubAlignment subAlignY = UISubAlignment::START;
|
|
|
|
void updateAlignment(
|
|
const glm::vec2 parentPosition,
|
|
const glm::vec2 parentSize,
|
|
const float_t canvasScale
|
|
) override;
|
|
};
|
|
} |