diff --git a/libs/kimath/include/math/vector2d.h b/libs/kimath/include/math/vector2d.h index 15b3d74907..5fcc2e2e35 100644 --- a/libs/kimath/include/math/vector2d.h +++ b/libs/kimath/include/math/vector2d.h @@ -357,21 +357,23 @@ VECTOR2 VECTOR2::Resize( T aNewLength ) const if( std::is_integral::value ) { - return VECTOR2 ( - ( x < 0 ? -1 : 1 ) * - KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ), - ( y < 0 ? -1 : 1 ) * - KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) ) - * sign( aNewLength ); + return VECTOR2( static_cast( + ( x < 0 ? -1 : 1 ) * + KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ) ), + static_cast( + ( y < 0 ? -1 : 1 ) * + KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) ) + * sign( aNewLength ) ); } else { - return VECTOR2 ( - ( x < 0 ? -1 : 1 ) * - std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ), - ( y < 0 ? -1 : 1 ) * - std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) - * sign( aNewLength ); + return VECTOR2 ( static_cast( + ( x < 0 ? -1 : 1 ) * + std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ), + static_cast( + ( y < 0 ? -1 : 1 ) * + std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) + * sign( aNewLength ) ); } }