Skip to content

Commit 3a58d8c

Browse files
rduivenvoordealexbruy
authored andcommittedDec 2, 2011
fix for #4500, endlessloop because of too small tolerance
1 parent 57da39a commit 3a58d8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/app/qgsmaptoolsimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
212212
bottomFound = true;
213213
highTol = tol;
214214
tol = ( highTol + lowTol ) / 2;
215-
if ( doubleNear( highTol, lowTol ) )
215+
if ( doubleNear( highTol, lowTol, 0.0001 ) ) // without 0.0001 tolerance sometimes an endless loop in epsg:4326
216216
{ //solving problem that two points are in same distance from line, so they will be both excluded at same time
217217
//so some time more than required count of vertices can stay
218218
found = true;
@@ -226,7 +226,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
226226
{
227227
lowTol = tol;
228228
tol = ( highTol + lowTol ) / 2;
229-
if ( doubleNear( highTol, lowTol ) )
229+
if ( doubleNear( highTol, lowTol, 0.0001 ) ) // without 0.0001 tolerance sometimes an endless loop in epsg:4326
230230
{ //solving problem that two points are in same distance from line, so they will be both excluded at same time
231231
//so some time more than required count of vertices can stay
232232
found = true;

0 commit comments

Comments
 (0)
Please sign in to comment.