Skip to content

Commit

Permalink
fix for #4500, endlessloop because of too small tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
rduivenvoorde authored and alexbruy committed Dec 2, 2011
1 parent 57da39a commit 3a58d8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolsimplify.cpp
Expand Up @@ -212,7 +212,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
bottomFound = true;
highTol = tol;
tol = ( highTol + lowTol ) / 2;
if ( doubleNear( highTol, lowTol ) )
if ( doubleNear( highTol, lowTol, 0.0001 ) ) // without 0.0001 tolerance sometimes an endless loop in epsg:4326
{ //solving problem that two points are in same distance from line, so they will be both excluded at same time
//so some time more than required count of vertices can stay
found = true;
Expand All @@ -226,7 +226,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
{
lowTol = tol;
tol = ( highTol + lowTol ) / 2;
if ( doubleNear( highTol, lowTol ) )
if ( doubleNear( highTol, lowTol, 0.0001 ) ) // without 0.0001 tolerance sometimes an endless loop in epsg:4326
{ //solving problem that two points are in same distance from line, so they will be both excluded at same time
//so some time more than required count of vertices can stay
found = true;
Expand Down

0 comments on commit 3a58d8c

Please sign in to comment.