fix right align

Signed-off-by: Sophia Hadash <sophiahadash@gmail.com>
This commit is contained in:
Sophia Hadash 2021-10-15 21:33:34 +02:00
parent c68f78f3d1
commit 1c93ca2c07

View file

@ -201,9 +201,10 @@ void FlexboxComponent::computeLayout()
if (!image.second.isVisible()) if (!image.second.isVisible())
continue; continue;
if (line == mLines) if (line == mLines)
image.second.setPosition(image.second.getPosition().x + image.second.setPosition(
(maxItemSize.x + mItemMargin.x) * n, image.second.getPosition().x +
image.second.getPosition().y); floorf((maxItemSize.x + mItemMargin.x) * static_cast<float>(n)),
image.second.getPosition().y);
if ((i++ + 1) % std::max(1, static_cast<int>(mItemsPerLine)) == 0) if ((i++ + 1) % std::max(1, static_cast<int>(mItemsPerLine)) == 0)
line++; line++;
} }