add 'min-size' ui property

This commit is contained in:
MihailRis
2025-01-18 06:37:27 +03:00
parent 0ce5e23a2a
commit 209490192c
4 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -290,7 +290,11 @@ const std::string& UINode::getId() const {
void UINode::reposition() {
if (sizefunc) {
setSize(sizefunc());
auto newSize = sizefunc();
setSize(
{newSize.x < 0 ? size.x : newSize.x,
newSize.y < 0 ? size.y : newSize.y}
);
}
if (positionfunc) {
setPos(positionfunc());
+3
View File
@@ -91,6 +91,9 @@ static void _readUINode(
if (element.has("pos")) {
node.setPos(element.attr("pos").asVec2());
}
if (element.has("min-size")) {
node.setMinSize(element.attr("min-size").asVec2());
}
if (element.has("size")) {
node.setSize(element.attr("size").asVec2());
}