From ff505365685afc1510d1899ad0a95bdffe898a79 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 25 Sep 2024 18:09:25 +0000 Subject: [PATCH] Fix positioning of stack amount text --- client/battle/BattleStacksController.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/battle/BattleStacksController.cpp b/client/battle/BattleStacksController.cpp index 7b69c9082..d3ac894d1 100644 --- a/client/battle/BattleStacksController.cpp +++ b/client/battle/BattleStacksController.cpp @@ -318,11 +318,10 @@ void BattleStacksController::showStackAmountBox(Canvas & canvas, const CStack * boxPosition = owner.fieldController->hexPositionLocal(frontPos).center() + Point(-8, -14); } - const auto & font = GH.renderHandler().loadFont(FONT_TINY); - Point textPosition = Point(amountBG->dimensions().x/2 + boxPosition.x, boxPosition.y + font->getLineHeight() - 6); + Point textPosition = Point(amountBG->dimensions().x/2 + boxPosition.x, boxPosition.y + amountBG->dimensions().y/2); canvas.draw(amountBG, boxPosition); - canvas.drawText(textPosition, EFonts::FONT_TINY, Colors::WHITE, ETextAlignment::TOPCENTER, TextOperations::formatMetric(stack->getCount(), 4)); + canvas.drawText(textPosition, EFonts::FONT_TINY, Colors::WHITE, ETextAlignment::CENTER, TextOperations::formatMetric(stack->getCount(), 4)); } void BattleStacksController::showStack(Canvas & canvas, const CStack * stack)