1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix positioning of stack amount text

This commit is contained in:
Ivan Savenko 2024-09-25 18:09:25 +00:00
parent b624069f86
commit ff50536568

View File

@ -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)