fix: 'gravity' does not work on hud overlays

This commit is contained in:
MihailRis 2024-07-29 20:29:23 +03:00
parent c947af904d
commit a66228eb41

View File

@ -507,12 +507,14 @@ void Hud::updateElementsPosition(const Viewport& viewport) {
height/2+totalHeight/2-invSize.y height/2+totalHeight/2-invSize.y
)); ));
} }
if (secondUI->getPositionFunc() == nullptr) {
secondUI->setPos(glm::vec2( secondUI->setPos(glm::vec2(
glm::min(width/2-invwidth/2, width-caWidth-(inventoryView ? 10 : 0)-invwidth), glm::min(width/2-invwidth/2, width-caWidth-(inventoryView ? 10 : 0)-invwidth),
height/2-totalHeight/2 height/2-totalHeight/2
)); ));
} }
} }
}
if (exchangeSlot != nullptr) { if (exchangeSlot != nullptr) {
exchangeSlot->setPos(glm::vec2(Events::cursor)); exchangeSlot->setPos(glm::vec2(Events::cursor));
} }