mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed a font rendering issue in TextListComponent.
This commit is contained in:
parent
b9a2031cf6
commit
77a2383683
|
@ -460,11 +460,14 @@ template <typename T> void TextListComponent<T>::render(const glm::mat4& parentT
|
||||||
glm::mat4 drawTrans {trans};
|
glm::mat4 drawTrans {trans};
|
||||||
|
|
||||||
// Currently selected item text might be looping.
|
// Currently selected item text might be looping.
|
||||||
if (mCursor == i && mLoopOffset > 0)
|
if (mCursor == i && mLoopOffset > 0) {
|
||||||
drawTrans = glm::translate(
|
drawTrans = glm::translate(
|
||||||
drawTrans, offset - glm::vec3 {static_cast<float>(mLoopOffset), 0.0f, 0.0f});
|
drawTrans,
|
||||||
else
|
glm::round(offset - glm::vec3 {static_cast<float>(mLoopOffset), 0.0f, 0.0f}));
|
||||||
drawTrans = glm::translate(drawTrans, offset);
|
}
|
||||||
|
else {
|
||||||
|
drawTrans = glm::translate(drawTrans, glm::round(offset));
|
||||||
|
}
|
||||||
|
|
||||||
// Needed to avoid flickering when returning to the start position.
|
// Needed to avoid flickering when returning to the start position.
|
||||||
if (mLoopOffset == 0 && mLoopOffset2 == 0)
|
if (mLoopOffset == 0 && mLoopOffset2 == 0)
|
||||||
|
@ -478,7 +481,8 @@ template <typename T> void TextListComponent<T>::render(const glm::mat4& parentT
|
||||||
mLoopScroll = true;
|
mLoopScroll = true;
|
||||||
drawTrans = trans;
|
drawTrans = trans;
|
||||||
drawTrans = glm::translate(
|
drawTrans = glm::translate(
|
||||||
drawTrans, offset - glm::vec3 {static_cast<float>(mLoopOffset2), 0.0f, 0.0f});
|
drawTrans,
|
||||||
|
glm::round(offset - glm::vec3 {static_cast<float>(mLoopOffset2), 0.0f, 0.0f}));
|
||||||
mRenderer->setMatrix(drawTrans);
|
mRenderer->setMatrix(drawTrans);
|
||||||
font->renderTextCache(entry.data.textCache.get());
|
font->renderTextCache(entry.data.textCache.get());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue