fix ingame chat size

This commit is contained in:
MihailRis 2025-03-31 14:15:51 +03:00
parent 0db778b4c2
commit 7b90fa15db
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<panel size="300,0" margin="0,0,0,70" max-length='300' min-length='0' <panel size="300,0" margin="0,0,0,70" max-length='300' min-length='0'
size-func="gui.get_viewport()[1]/2,-1" size-func="gui.get_viewport()[1]/2,0"
padding="0" padding="0"
min-size="0" min-size="0"
color="0" color="0"

View File

@ -300,11 +300,13 @@ const std::string& UINode::getId() const {
void UINode::reposition() { void UINode::reposition() {
if (sizefunc) { if (sizefunc) {
auto newSize = sizefunc(); glm::ivec2 newSize = sizefunc();
auto defsize = newSize; glm::ivec2 defsize = newSize;
if (parent) { if (parent) {
defsize = parent->getSize(); defsize = parent->getSize();
} }
newSize.x = newSize.x == 0 ? size.x : newSize.x;
newSize.y = newSize.y == 0 ? size.y : newSize.y;
setSize( setSize(
{newSize.x < 0 ? defsize.x + (newSize.x + 1) : newSize.x, {newSize.x < 0 ? defsize.x + (newSize.x + 1) : newSize.x,
newSize.y < 0 ? defsize.y + (newSize.y + 1) : newSize.y} newSize.y < 0 ? defsize.y + (newSize.y + 1) : newSize.y}