Skip to content

Commit

Permalink
Point locator: fix addition of features when OTF reprojection is on
Browse files Browse the repository at this point in the history
This would cause issues when editing geometries with OTF on.
Discovered by @nirvn
  • Loading branch information
wonder-sk committed Jan 25, 2015
1 parent 62b2c1f commit 01286cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgspointlocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid )
QgsFeature f;
if ( mLayer->getFeatures( QgsFeatureRequest( fid ) ).nextFeature( f ) )
{
if ( !f.geometry() )
return;

if ( mTransform )
f.geometry()->transform( *mTransform );

SpatialIndex::Region r( rect2region( f.geometry()->boundingBox() ) );
mRTree->insertData( 0, 0, r, f.id() );
mGeoms[fid] = new QgsGeometry( *f.geometry() );
Expand Down

0 comments on commit 01286cc

Please sign in to comment.