bugfix, simplification

Signed-off-by: Sophia Hadash <sophiahadash@gmail.com>
This commit is contained in:
shadash 2021-10-17 01:11:01 +02:00 committed by Sophia Hadash
parent 1c93ca2c07
commit 8fd05fcd77

View file

@ -194,7 +194,8 @@ void FlexboxComponent::computeLayout()
// Apply right-align // Apply right-align
if (mAlignment == "right") { if (mAlignment == "right") {
unsigned int n = mItemsPerLine - (--i + 1) % std::max(1, static_cast<int>(mItemsPerLine)); unsigned int m = i % std::max(1, static_cast<int>(mItemsPerLine));
unsigned int n = m > 0 ? mItemsPerLine - m : m;
i = 0; i = 0;
unsigned int line = 1; unsigned int line = 1;
for (auto& image : mImages) { for (auto& image : mImages) {