add 'min-size' ui property
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user