mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
Moved fonts handling from Graphics to RenderHandler class
This commit is contained in:
@ -188,6 +188,8 @@ void MapViewCache::render(const std::shared_ptr<IMapRendererContext> & context,
|
||||
|
||||
if(context->showTextOverlay())
|
||||
{
|
||||
const auto & font = GH.renderHandler().loadFont(FONT_TINY);
|
||||
|
||||
for(int y = dimensions.top(); y < dimensions.bottom(); ++y)
|
||||
{
|
||||
for(int x = dimensions.left(); x < dimensions.right(); ++x)
|
||||
@ -204,8 +206,6 @@ void MapViewCache::render(const std::shared_ptr<IMapRendererContext> & context,
|
||||
else
|
||||
position.y -= targetRect.h / 4;
|
||||
|
||||
const auto font = graphics->fonts[EFonts::FONT_TINY];
|
||||
|
||||
Point dimensions(font->getStringWidth(overlay), font->getLineHeight());
|
||||
Rect textRect = Rect(position - dimensions / 2, dimensions).resize(2);
|
||||
|
||||
|
Reference in New Issue
Block a user