From 5fa8ec8586e3c9087fd68129e1b7d7f94e847a09 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 26 Sep 2019 11:35:31 -0400 Subject: begin config usage; text positioning --- src/text.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/text.cpp') diff --git a/src/text.cpp b/src/text.cpp index 9b59f8a..6917a2c 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -53,6 +53,7 @@ void TextSystem::loadFont(const std::string& name, auto& face = fonts[file]; FT_Set_Pixel_Sizes(face, 0, size); fontData.try_emplace(name); + fontData[name].fontSize = size; // Calculate dimensions of final texture // @@ -130,6 +131,8 @@ void TextSystem::put(const std::string& font, if (fontData.find(font) == fontData.end()) return; + y -= fontData[font].fontSize; + auto& vector = fontData[font].text; if (auto i = std::find_if(vector.begin(), vector.end(), [&x, &y](const Text& t) { return t.x == x && t.y == y; }); i != vector.end()) { -- cgit v1.2.3