Changed a rounding in ScrollableContainer to slightly decrease the risk of glyphs getting cut off at the bottom of the container

This commit is contained in:
Leon Styhre 2024-09-15 11:39:04 +02:00
parent 5300e54295
commit 4b24cb0d4e

View file

@ -89,7 +89,7 @@ void ScrollableContainer::resetComponent()
float numLines {std::floor(mSize.y / combinedHeight)};
if (numLines == 0)
numLines = 1;
mAdjustedHeight = std::round(numLines * combinedHeight);
mAdjustedHeight = std::ceil(numLines * combinedHeight);
}
else {
mAdjustedHeight = mSize.y;
@ -163,7 +163,7 @@ void ScrollableContainer::update(int deltaTime)
float numLines {std::floor(mSize.y / combinedHeight)};
if (numLines == 0)
numLines = 1;
mAdjustedHeight = std::round(numLines * combinedHeight);
mAdjustedHeight = std::ceil(numLines * combinedHeight);
}
else {
mAdjustedHeight = mSize.y;