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:
parent
b624069f86
commit
ff50536568
@ -318,11 +318,10 @@ void BattleStacksController::showStackAmountBox(Canvas & canvas, const CStack *
|
|||||||
boxPosition = owner.fieldController->hexPositionLocal(frontPos).center() + Point(-8, -14);
|
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 + amountBG->dimensions().y/2);
|
||||||
Point textPosition = Point(amountBG->dimensions().x/2 + boxPosition.x, boxPosition.y + font->getLineHeight() - 6);
|
|
||||||
|
|
||||||
canvas.draw(amountBG, boxPosition);
|
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)
|
void BattleStacksController::showStack(Canvas & canvas, const CStack * stack)
|
||||||
|
Loading…
Reference in New Issue
Block a user