Fixed some small rounding issues in TextListComponent.h

This commit is contained in:
Leon Styhre 2021-10-18 19:15:50 +02:00
parent 0fecb43066
commit ccc3cae46b

View file

@ -223,8 +223,10 @@ template <typename T> void TextListComponent<T>::render(const glm::mat4& parentT
dim.y = (trans[1].y * dim.y + trans[3].y) - trans[3].y;
Renderer::pushClipRect(
glm::ivec2{static_cast<int>(trans[3].x + mHorizontalMargin), static_cast<int>(trans[3].y)},
glm::ivec2{static_cast<int>(dim.x - mHorizontalMargin * 2.0f), static_cast<int>(dim.y)});
glm::ivec2{static_cast<int>(std::round(trans[3].x + mHorizontalMargin)),
static_cast<int>(std::round(trans[3].y))},
glm::ivec2{static_cast<int>(std::round(dim.x - mHorizontalMargin * 2.0f)),
static_cast<int>(std::round(dim.y))});
for (int i = startEntry; i < listCutoff; i++) {
typename IList<TextListData, T>::Entry& entry = mEntries.at(static_cast<unsigned int>(i));