Skip to content

Commit

Permalink
Merge pull request #1086 from ahuarte47/Issue_9360
Browse files Browse the repository at this point in the history
fix bug whole layer not rendered (when simplify geometry activated; fixes #9360)
  • Loading branch information
jef-n committed Jan 17, 2014
2 parents 71360c3 + cc13f9d commit 8c9f41c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -728,8 +728,8 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
double sourceHypothenuse = sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
double targetHypothenuse = sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );

if ( sourceHypothenuse != 0 )
map2pixelTol *= targetHypothenuse / sourceHypothenuse;
if ( targetHypothenuse != 0 )
map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
}

QgsSimplifyMethod simplifyMethod;
Expand Down Expand Up @@ -1258,7 +1258,7 @@ bool QgsVectorLayer::setSubsetString( QString subset )

bool QgsVectorLayer::simplifyDrawingCanbeApplied( int simplifyHint ) const
{
return mDataProvider && !mEditBuffer && ( mSimplifyMethod.simplifyHints() & simplifyHint ) && ( !mCurrentRendererContext || mCurrentRendererContext->useRenderingOptimization() );
return mDataProvider && !mEditBuffer && ( hasGeometryType() && geometryType() != QGis::Point ) && ( mSimplifyMethod.simplifyHints() & simplifyHint ) && ( !mCurrentRendererContext || mCurrentRendererContext->useRenderingOptimization() );
}

QgsFeatureIterator QgsVectorLayer::getFeatures( const QgsFeatureRequest& request )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -455,7 +455,7 @@ bool QgsVectorLayerFeatureIterator::prepareSimplification( const QgsSimplifyMeth
mEditGeometrySimplifier = NULL;

// setup simplification for edited geometries to fetch
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) && simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification )
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) && simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification && L->hasGeometryType() && L->geometryType() != QGis::Point )
{
mEditGeometrySimplifier = QgsSimplifyMethod::createGeometrySimplifier( simplifyMethod );
return mEditGeometrySimplifier != NULL;
Expand Down

0 comments on commit 8c9f41c

Please sign in to comment.