Skip to content

Commit

Permalink
More solid precision estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent d0728ef commit 29b1dd7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -176,9 +176,17 @@ void QgsGeometryValidationService::enableLayerChecks( QgsVectorLayer *layer )
return;
}

int precision = log10( layer->geometryOptions()->geometryPrecision() ) * -1;
if ( precision == 0 )
int precision = 0;
if ( layer->geometryOptions()->geometryPrecision() == 0 )
precision = 8;
else
{
precision = log10( layer->geometryOptions()->geometryPrecision() ) * -1;

if ( precision < 1 || precision > 13 )
precision = 8;
}

checkInformation.context = qgis::make_unique<QgsGeometryCheckContext>( precision, mProject->crs(), mProject->transformContext() );

QList<QgsGeometryCheck *> layerChecks;
Expand Down

0 comments on commit 29b1dd7

Please sign in to comment.