Changed negative recursion level argument to positive
BEZIER_POLY::recursiveBezier() was called with negated 'level' variable as an argument which is incorrect for an unsigned type.
This commit is contained in:
parent
e4feb315d5
commit
c960d671cd
|
@ -68,7 +68,8 @@ void BEZIER_POLY::GetPoly( std::vector<wxPoint>& aOutput )
|
|||
}
|
||||
|
||||
|
||||
void BEZIER_POLY::recursiveBezier( int x1, int y1, int x2, int y2, int x3, int y3, unsigned int level )
|
||||
void BEZIER_POLY::recursiveBezier( int x1, int y1, int x2, int y2,
|
||||
int x3, int y3, unsigned int level )
|
||||
{
|
||||
if( level > recursion_limit )
|
||||
return;
|
||||
|
@ -154,11 +155,12 @@ void BEZIER_POLY::recursiveBezier( int x1, int y1, int x2, int y2, int x3, int y
|
|||
// Continue subdivision
|
||||
//----------------------
|
||||
recursiveBezier( x1, y1, x12, y12, x123, y123, level + 1 );
|
||||
recursiveBezier( x123, y123, x23, y23, x3, y3, -(level + 1) );
|
||||
recursiveBezier( x123, y123, x23, y23, x3, y3, level + 1 );
|
||||
}
|
||||
|
||||
|
||||
void BEZIER_POLY::recursiveBezier( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, unsigned int level )
|
||||
void BEZIER_POLY::recursiveBezier( int x1, int y1, int x2, int y2,
|
||||
int x3, int y3, int x4, int y4, unsigned int level )
|
||||
{
|
||||
if( level > recursion_limit )
|
||||
return;
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
// Conversion parameters
|
||||
constexpr static double angle_tolerance = 0.0;
|
||||
constexpr static double cusp_limit = 0.0;
|
||||
constexpr static int recursion_limit = 12;
|
||||
constexpr static unsigned int recursion_limit = 12;
|
||||
constexpr static double approximation_scale = 0.5; // 1
|
||||
constexpr static double distance_tolerance_square = ( 0.5 / approximation_scale ) * ( 0.5 / approximation_scale );
|
||||
|
||||
|
|
Loading…
Reference in New Issue