From 9d23d124d4bfff3e6d7e6086af06dbb3a10c723e Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 21:34:38 +0200 Subject: [PATCH] change casts to c++ style Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 94ced8bea..2827f5995 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -95,7 +95,8 @@ void FlexboxComponent::computeLayout() // Pre-compute layout parameters. int n = mChildren.size(); - int nLines = std::max(1, (int)std::ceil(n / std::max(1, (int)mItemsPerLine))); + int nLines = + std::max(1, static_cast(std::ceil(n / std::max(1, static_cast(mItemsPerLine))))); float lineWidth = (mDirection == "row" ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); float anchorXStart = anchorX; @@ -144,7 +145,7 @@ void FlexboxComponent::computeLayout() child->setPosition(getPosition().x + x, getPosition().y + y); // Translate anchor. - if ((i + 1) % std::max(1, (int)mItemsPerLine) != 0) { + if ((i + 1) % std::max(1, static_cast(mItemsPerLine)) != 0) { // Translate on same line. anchorX += (size.x + mItemMargin.x) * directionLine.x; anchorY += (size.y + mItemMargin.y) * directionLine.y;