cppcheck: avoid possible division by 0
Change-Id: I8ff8e72d0d25168da374d752a18210cf764ed311
This commit is contained in:
parent
3209594748
commit
9fb9b057d6
@ -371,11 +371,10 @@ void CGM::ImplDoClass4()
|
||||
|
||||
double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) );
|
||||
|
||||
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
|
||||
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
|
||||
|
||||
if ( fG != 0 )
|
||||
{
|
||||
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
|
||||
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
|
||||
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
|
||||
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
|
||||
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );
|
||||
@ -445,11 +444,10 @@ void CGM::ImplDoClass4()
|
||||
|
||||
double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) );
|
||||
|
||||
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
|
||||
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
|
||||
|
||||
if ( fG != 0 )
|
||||
{
|
||||
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
|
||||
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
|
||||
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
|
||||
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
|
||||
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );
|
||||
|
Loading…
x
Reference in New Issue
Block a user