aboutsummaryrefslogtreecommitdiffstats
path: root/src/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp3
1 files changed, 3 insertions, 0 deletions
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()) {