Fixed an issue where the menus would sometimes contain fractional rows

This commit is contained in:
Leon Styhre 2025-03-17 17:10:23 +01:00
parent 8ecc7cfce2
commit e13cac5f0b

View file

@ -239,9 +239,10 @@ void ComponentList::render(const glm::mat4& parentTrans)
return;
glm::mat4 trans {parentTrans * getTransform()};
int overflow {(static_cast<int>(std::round(mSize.y)) % static_cast<int>(mRowHeight))};
// Clip everything to be inside our bounds.
glm::vec3 dim {mSize.x, mSize.y, 0.0f};
glm::vec3 dim {mSize.x, mSize.y - overflow, 0.0f};
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;