Skip to content

Commit

Permalink
Do not allow 0 precision
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent 4d40d2f commit a56062c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -85,7 +85,7 @@ void QgsGeometryValidationService::onLayersAdded( const QList<QgsMapLayer *> &la
{
cleanupLayerChecks( vectorLayer );
mLayerChecks.remove( vectorLayer );
});
} );

enableLayerChecks( vectorLayer );
}
Expand Down Expand Up @@ -141,7 +141,7 @@ void QgsGeometryValidationService::onBeforeCommitChanges( QgsVectorLayer *layer
}
}

void QgsGeometryValidationService::cleanupLayerChecks(QgsVectorLayer* layer)
void QgsGeometryValidationService::cleanupLayerChecks( QgsVectorLayer *layer )
{
if ( !mLayerChecks.contains( layer ) )
return;
Expand Down Expand Up @@ -174,7 +174,10 @@ void QgsGeometryValidationService::enableLayerChecks( QgsVectorLayer *layer )
return;
}

checkInformation.context = new QgsGeometryCheckContext( log10( layer->geometryOptions()->geometryPrecision() ) * -1, mProject->crs(), mProject->transformContext() );
int precision = log10( layer->geometryOptions()->geometryPrecision() ) * -1;
if ( precision == 0 )
precision = 8;
checkInformation.context = qgis::make_unique<QgsGeometryCheckContext>( precision, mProject->crs(), mProject->transformContext() );

QList<QgsGeometryCheck *> layerChecks;

Expand Down Expand Up @@ -355,7 +358,8 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
{
sharedErrors.append( std::shared_ptr<QgsGeometryCheckError>( error ) );
}
allErrors.append(sharedErrors);

allErrors.append( sharedErrors );
if ( !feedback->isCanceled() )
emit topologyChecksUpdated( layer, sharedErrors );

Expand Down

0 comments on commit a56062c

Please sign in to comment.