From a66228eb412e6b5d46c70c5f2a46aebe280e2ecb Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 29 Jul 2024 20:29:23 +0300 Subject: [PATCH] fix: 'gravity' does not work on hud overlays --- src/frontend/hud.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index e43c4f6b..67bfa741 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -507,10 +507,12 @@ void Hud::updateElementsPosition(const Viewport& viewport) { height/2+totalHeight/2-invSize.y )); } - secondUI->setPos(glm::vec2( - glm::min(width/2-invwidth/2, width-caWidth-(inventoryView ? 10 : 0)-invwidth), - height/2-totalHeight/2 - )); + if (secondUI->getPositionFunc() == nullptr) { + secondUI->setPos(glm::vec2( + glm::min(width/2-invwidth/2, width-caWidth-(inventoryView ? 10 : 0)-invwidth), + height/2-totalHeight/2 + )); + } } } if (exchangeSlot != nullptr) {