Skip to content

Commit cc13f9d

Browse files
committed
#9360: fix bug simplification when transform is activated
1 parent d8b55a2 commit cc13f9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/qgsvectorlayer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,8 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
728728
double sourceHypothenuse = sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
729729
double targetHypothenuse = sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );
730730

731-
if ( sourceHypothenuse != 0 )
732-
map2pixelTol *= targetHypothenuse / sourceHypothenuse;
731+
if ( targetHypothenuse != 0 )
732+
map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
733733
}
734734

735735
QgsSimplifyMethod simplifyMethod;
@@ -1258,7 +1258,7 @@ bool QgsVectorLayer::setSubsetString( QString subset )
12581258

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

12641264
QgsFeatureIterator QgsVectorLayer::getFeatures( const QgsFeatureRequest& request )

src/core/qgsvectorlayerfeatureiterator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ bool QgsVectorLayerFeatureIterator::prepareSimplification( const QgsSimplifyMeth
455455
mEditGeometrySimplifier = NULL;
456456

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

0 commit comments

Comments
 (0)