From 36ee9f72e2ca4e814d612af3f932e2677b5a0fc1 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 8 Dec 2022 03:57:11 +0300 Subject: [PATCH] Increase default padding to 1 in GetClampedCoords to avoid overflow msg. --- libs/kimath/include/geometry/geometry_utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/kimath/include/geometry/geometry_utils.h b/libs/kimath/include/geometry/geometry_utils.h index db036eead2..7cbf4f0231 100644 --- a/libs/kimath/include/geometry/geometry_utils.h +++ b/libs/kimath/include/geometry/geometry_utils.h @@ -134,9 +134,9 @@ VECTOR2 GetVectorSnapped45( const VECTOR2& aVec, bool only45 = false ) /** * Clamps a vector to values that can be negated, respecting numeric limits * of coordinates data type with specified padding. - * + * * Numeric limits are (-2^31 + 1) to (2^31 - 1). - * + * * Takes care of rounding in case of floating point to integer conversion. * * @param aCoord - vector to clamp. @@ -145,7 +145,7 @@ VECTOR2 GetVectorSnapped45( const VECTOR2& aVec, bool only45 = false ) */ template ::value>::type> -VECTOR2 GetClampedCoords( const VECTOR2& aCoords, pad_type aPadding = 0u ) +VECTOR2 GetClampedCoords( const VECTOR2& aCoords, pad_type aPadding = 1u ) { typedef std::numeric_limits coord_limits;