aboutsummaryrefslogtreecommitdiffstats
path: root/src/text.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-26 11:35:31 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-26 11:35:31 -0400
commit5fa8ec8586e3c9087fd68129e1b7d7f94e847a09 (patch)
tree451946789bd3fc0b79a80b5b3007d26c2159f428 /src/text.cpp
parent00da4d690af08d45788d770f9aadc9548438f074 (diff)
begin config usage; text positioning
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()) {