mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Moved fonts handling from Graphics to RenderHandler class
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "../gui/Shortcut.h"
|
||||
#include "../render/Graphics.h"
|
||||
#include "../render/IFont.h"
|
||||
#include "../render/IRenderHandler.h"
|
||||
#include "../widgets/CComponent.h"
|
||||
#include "../widgets/ComboBox.h"
|
||||
#include "../widgets/Buttons.h"
|
||||
@@ -357,8 +358,9 @@ std::shared_ptr<CMultiLineLabel> InterfaceObjectConfigurable::buildMultiLineLabe
|
||||
auto color = readColor(config["color"]);
|
||||
auto text = readText(config["text"]);
|
||||
Rect rect = readRect(config["rect"]);
|
||||
const auto & fontPtr = GH.renderHandler().loadFont(font);
|
||||
if(!config["adoptHeight"].isNull() && config["adoptHeight"].Bool())
|
||||
rect.h = graphics->fonts[font]->getLineHeight() * 2;
|
||||
rect.h = fontPtr->getLineHeight() * 2;
|
||||
return std::make_shared<CMultiLineLabel>(rect, font, alignment, color, text);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user