diff --git a/libs/kimath/src/geometry/ellipse.cpp b/libs/kimath/src/geometry/ellipse.cpp index 4b9e070ee2..089192d7d0 100644 --- a/libs/kimath/src/geometry/ellipse.cpp +++ b/libs/kimath/src/geometry/ellipse.cpp @@ -43,7 +43,7 @@ ELLIPSE::ELLIPSE( const VECTOR2& aCenter, EndAngle( aEndAngle ) { MajorRadius = aMajor.EuclideanNorm(); - MinorRadius = MajorRadius * aRatio; + MinorRadius = NumericType( MajorRadius * aRatio ); Rotation = EDA_ANGLE( std::atan2( aMajor.y, aMajor.x ), RADIANS_T ); } diff --git a/libs/kimath/src/geometry/seg.cpp b/libs/kimath/src/geometry/seg.cpp index ee02eb4fd3..b07aa7493c 100644 --- a/libs/kimath/src/geometry/seg.cpp +++ b/libs/kimath/src/geometry/seg.cpp @@ -251,7 +251,7 @@ bool SEG::Collide( const SEG& aSeg, int aClearance, int* aActual ) const if( dist_sq == 0 || dist_sq < (ecoord) aClearance * aClearance ) { if( aActual ) - *aActual = isqrt( dist_sq ); + *aActual = int( isqrt( dist_sq ) ); return true; } @@ -328,13 +328,13 @@ VECTOR2I SEG::LineProject( const VECTOR2I& aP ) const int SEG::Distance( const SEG& aSeg ) const { - return isqrt( SquaredDistance( aSeg ) ); + return int( isqrt( SquaredDistance( aSeg ) ) ); } int SEG::Distance( const VECTOR2I& aP ) const { - return isqrt( SquaredDistance( aP ) ); + return int( isqrt( SquaredDistance( aP ) ) ); } diff --git a/libs/kimath/src/trigo.cpp b/libs/kimath/src/trigo.cpp index 804a0deeaa..ca6398cb57 100644 --- a/libs/kimath/src/trigo.cpp +++ b/libs/kimath/src/trigo.cpp @@ -311,8 +311,8 @@ const VECTOR2D CalcArcCenter( const VECTOR2D& aStart, const VECTOR2D& aEnd, if( d_squared > 0.0 ) d = sqrt( d_squared ); - VECTOR2D vec2 = (end - start).Resize( d ); - VECTOR2D vc = (end - start).Resize( chord / 2 ); + VECTOR2D vec2 = VECTOR2D(end - start).Resize( d ); + VECTOR2D vc = VECTOR2D(end - start).Resize( chord / 2 ); RotatePoint( vec2, -ANGLE_90 );