From 1c93ca2c0759fc2a5d067b9bf4b3a08d33d70cbf Mon Sep 17 00:00:00 2001 From: Sophia Hadash Date: Fri, 15 Oct 2021 21:33:34 +0200 Subject: [PATCH] fix right align Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index f448fbc16..a31871102 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -201,9 +201,10 @@ void FlexboxComponent::computeLayout() if (!image.second.isVisible()) continue; if (line == mLines) - image.second.setPosition(image.second.getPosition().x + - (maxItemSize.x + mItemMargin.x) * n, - image.second.getPosition().y); + image.second.setPosition( + image.second.getPosition().x + + floorf((maxItemSize.x + mItemMargin.x) * static_cast(n)), + image.second.getPosition().y); if ((i++ + 1) % std::max(1, static_cast(mItemsPerLine)) == 0) line++; }