From eb05d803df98a7bb24d69a7c5eed6a6ad32618d1 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 8 Dec 2022 04:43:30 +0300 Subject: [PATCH] Use typename with extended_type. --- libs/kimath/include/geometry/geometry_utils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/kimath/include/geometry/geometry_utils.h b/libs/kimath/include/geometry/geometry_utils.h index 8220fcdff9..fd162b81b0 100644 --- a/libs/kimath/include/geometry/geometry_utils.h +++ b/libs/kimath/include/geometry/geometry_utils.h @@ -104,15 +104,17 @@ int GetCircleToPolyCorrection( int aMaxError ); template VECTOR2 GetVectorSnapped45( const VECTOR2& aVec, bool only45 = false ) { + using ext_type = typename VECTOR2::extended_type; + auto newVec = aVec; const VECTOR2 absVec{ std::abs( aVec.x ), std::abs( aVec.y ) }; - if( !only45 && absVec.x > VECTOR2::extended_type( absVec.y ) * 2 ) + if( !only45 && absVec.x > ext_type( absVec.y ) * 2 ) { // snap along x-axis newVec.y = 0; } - else if( !only45 && absVec.y > VECTOR2::extended_type( absVec.x ) * 2 ) + else if( !only45 && absVec.y > ext_type( absVec.x ) * 2 ) { // snap onto y-axis newVec.x = 0;