From 70a1e4612aed815f2498a7d104fb55198c20b6df Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 19 Aug 2021 19:53:05 +0200 Subject: [PATCH] Fixed an issue where menu rows would not align properly during navigation. --- es-core/src/components/ComponentList.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index ab58e661e..a60c61b0b 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -179,13 +179,11 @@ void ComponentList::render(const glm::mat4& parentTrans) dim.x = (trans[0].x * dim.x + trans[3].x) - trans[3].x; dim.y = (trans[1].y * dim.y + trans[3].y) - trans[3].y; - Renderer::pushClipRect( - glm::ivec2{static_cast(std::round(trans[3].x)), - static_cast(std::round(trans[3].y))}, - glm::ivec2{static_cast(std::round(dim.x)), static_cast(std::round(dim.y))}); + Renderer::pushClipRect(glm::ivec2{static_cast(trans[3].x), static_cast(trans[3].y)}, + glm::ivec2{static_cast(dim.x), static_cast(dim.y)}); // Scroll the camera. - trans = glm::translate(trans, glm::vec3{0.0f, -std::round(mCameraOffset), 0.0f}); + trans = glm::translate(trans, glm::vec3{0.0f, -mCameraOffset, 0.0f}); // Draw our entries. std::vector drawAfterCursor; @@ -287,7 +285,7 @@ float ComponentList::getRowHeight(const ComponentListRow& row) const height = row.elements.at(i).component->getSize().y; } - return height; + return std::floor(height); } float ComponentList::getTotalRowHeight() const