minor refactor Button

This commit is contained in:
MihailRis
2025-06-27 22:50:47 +03:00
parent ead46158d9
commit f473df33fb
4 changed files with 29 additions and 17 deletions
+11
View File
@@ -27,6 +27,17 @@ int Panel::getMinLength() const {
return minLength;
}
void Panel::setContentSize(const glm::ivec2& contentSize) {
setSize(glm::vec2(
glm::max(padding.x + padding.z + contentSize.x, size.x),
glm::max(padding.y + padding.w + contentSize.y, size.y)
));
}
glm::vec2 Panel::getContentSize() const {
return size - glm::vec2(padding.z + padding.x, padding.w + padding.y);
}
void Panel::cropToContent() {
if (maxLength > 0.0f) {
setSize(glm::vec2(