Skip to content
Permalink
Browse files

Do not allow 0 precision

  • Loading branch information
m-kuhn committed Oct 2, 2018
1 parent 4d40d2f commit a56062c50db297f7ab4edfc68c187543b9b60ab9
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/app/qgsgeometryvalidationservice.cpp
@@ -85,7 +85,7 @@ void QgsGeometryValidationService::onLayersAdded( const QList<QgsMapLayer *> &la
{
cleanupLayerChecks( vectorLayer );
mLayerChecks.remove( vectorLayer );
});
} );

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

void QgsGeometryValidationService::cleanupLayerChecks(QgsVectorLayer* layer)
void QgsGeometryValidationService::cleanupLayerChecks( QgsVectorLayer *layer )
{
if ( !mLayerChecks.contains( layer ) )
return;
@@ -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;

@@ -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 );

0 comments on commit a56062c

Please sign in to comment.
You can’t perform that action at this time.