mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 17:45:38 +00:00
Fixed an issue where menu rows would not align properly during navigation.
This commit is contained in:
parent
9e629e033b
commit
70a1e4612a
|
@ -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.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;
|
dim.y = (trans[1].y * dim.y + trans[3].y) - trans[3].y;
|
||||||
|
|
||||||
Renderer::pushClipRect(
|
Renderer::pushClipRect(glm::ivec2{static_cast<int>(trans[3].x), static_cast<int>(trans[3].y)},
|
||||||
glm::ivec2{static_cast<int>(std::round(trans[3].x)),
|
glm::ivec2{static_cast<int>(dim.x), static_cast<int>(dim.y)});
|
||||||
static_cast<int>(std::round(trans[3].y))},
|
|
||||||
glm::ivec2{static_cast<int>(std::round(dim.x)), static_cast<int>(std::round(dim.y))});
|
|
||||||
|
|
||||||
// Scroll the camera.
|
// 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.
|
// Draw our entries.
|
||||||
std::vector<GuiComponent*> drawAfterCursor;
|
std::vector<GuiComponent*> drawAfterCursor;
|
||||||
|
@ -287,7 +285,7 @@ float ComponentList::getRowHeight(const ComponentListRow& row) const
|
||||||
height = row.elements.at(i).component->getSize().y;
|
height = row.elements.at(i).component->getSize().y;
|
||||||
}
|
}
|
||||||
|
|
||||||
return height;
|
return std::floor(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ComponentList::getTotalRowHeight() const
|
float ComponentList::getTotalRowHeight() const
|
||||||
|
|
Loading…
Reference in a new issue