From bfcd0877519c0cae65f26ff2d4cf135c1f402500 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sat, 2 Dec 2023 17:04:19 +0300 Subject: [PATCH] Add KiROUND for VECTOR2 types. --- libs/kimath/include/math/vector2d.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/kimath/include/math/vector2d.h b/libs/kimath/include/math/vector2d.h index 53ceb8261c..90cda163f3 100644 --- a/libs/kimath/include/math/vector2d.h +++ b/libs/kimath/include/math/vector2d.h @@ -587,6 +587,12 @@ std::ostream& operator<<( std::ostream& aStream, const VECTOR2& aVector ) typedef VECTOR2 VECTOR2D; typedef VECTOR2 VECTOR2I; +/* KiROUND specialization for vectors */ +inline VECTOR2I KiROUND( const VECTOR2D& vec ) +{ + return VECTOR2I( KiROUND( vec.x ), KiROUND( vec.y ) ); +} + /* STL specializations */ namespace std {