Better fix for issue fixed in rev 6350

This commit is contained in:
jean-pierre charras 2015-12-07 14:51:46 +01:00
parent fefa8d16f0
commit ab7350bf2d
1 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
#include <float.h>
#include <limits.h>
#include <common.h>
#include <stdlib.h> // for abs function
#include <cstdlib> // for abs function on ints
#include <math_for_graphics.h>
static bool InRange( double x, double xi, double xf );
@ -464,7 +464,7 @@ double GetPointToLineSegmentDistance( int x, int y, int xi, int yi, int xf, int
{
// vertical line segment
if( InRange( y, yi, yf ) )
return abs( x - xi );
return std::abs( x - xi );
else
return std::min( Distance( x, y, xi, yi ), Distance( x, y, xf, yf ) );
}
@ -472,7 +472,7 @@ double GetPointToLineSegmentDistance( int x, int y, int xi, int yi, int xf, int
{
// horizontal line segment
if( InRange( x, xi, xf ) )
return abs( y - yi );
return std::abs( y - yi );
else
return std::min( Distance( x, y, xi, yi ), Distance( x, y, xf, yf ) );
}