Formatting.

This commit is contained in:
Jeff Young 2020-11-10 18:07:27 +00:00
parent 5bffc852ee
commit 63773809d0
1 changed files with 3 additions and 6 deletions

View File

@ -169,15 +169,13 @@ inline double DistanceLinePoint( const wxPoint &linePointA,
//! @param pointB Second point //! @param pointB Second point
//! @param threshold The maximum distance //! @param threshold The maximum distance
//! @return True or false //! @return True or false
inline bool HitTestPoints( const wxPoint &pointA, const wxPoint &pointB, inline bool HitTestPoints( const wxPoint &pointA, const wxPoint &pointB, double threshold )
double threshold )
{ {
wxPoint vectorAB = pointB - pointA; wxPoint vectorAB = pointB - pointA;
// Compare the distances squared. The double is needed to avoid // Compare the distances squared. The double is needed to avoid
// overflow during int multiplication // overflow during int multiplication
double sqdistance = (double)vectorAB.x * vectorAB.x + double sqdistance = (double)vectorAB.x * vectorAB.x + (double)vectorAB.y * vectorAB.y;
(double)vectorAB.y * vectorAB.y;
return sqdistance < threshold * threshold; return sqdistance < threshold * threshold;
} }
@ -199,8 +197,7 @@ inline double CrossProduct( const wxPoint &vectorA, const wxPoint &vectorB )
* @param aEnd is the second end-point of the line segment * @param aEnd is the second end-point of the line segment
* @param aDist = maximum distance for hit * @param aDist = maximum distance for hit
*/ */
bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist );
wxPoint aEnd, int aDist );
/** /**
* Return the length of a line segment defined by \a aPointA and \a aPointB. * Return the length of a line segment defined by \a aPointA and \a aPointB.