summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-08-21 13:45:53 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-08-21 13:45:53 +0100
commit51b667f0cb48f95549eef3a024af795cf4834d95 (patch)
treec21a06d07b6a7b3f891fc0b300e19e534e01dd62
parentReduce variable scope (diff)
downloadilt-51b667f0cb48f95549eef3a024af795cf4834d95.tar.bz2
ilt-51b667f0cb48f95549eef3a024af795cf4834d95.tar.xz
ilt-51b667f0cb48f95549eef3a024af795cf4834d95.zip
Fix shadowing
-rw-r--r--ui/font.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/font.cpp b/ui/font.cpp
index e5432b8..93b36e1 100644
--- a/ui/font.cpp
+++ b/ui/font.cpp
@@ -172,11 +172,11 @@ Font::render(const std::string_view chars) const
}
const auto charPos = pos + glm::vec2 {ch.bearing.x, ch.bearing.y - static_cast<int>(ch.size.y)};
- const auto size = glm::vec2 {ch.size};
+ const auto chSize = glm::vec2 {ch.size};
out[fontTextures[ch.textureIdx].texture].emplace_back(
- transform_array(C, [&size, &charPos, &ch, this](const auto & c) {
- return (charPos + (size * c.first))
+ transform_array(C, [&chSize, &charPos, &ch, this](const auto & c) {
+ return (charPos + (chSize * c.first))
|| ((glm::vec2 {ch.position} + (glm::vec2 {ch.size} * c.second)) / glm::vec2 {this->size});
}));