Skip to content

Commit

Permalink
#9360: fix bug simplification when transform is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Jan 17, 2014
1 parent d8b55a2 commit cc13f9d
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 cc13f9d

Please sign in to comment.