File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1657,7 +1657,7 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
1657
1657
}
1658
1658
}
1659
1659
1660
- // else, if must be contained in mCachedGeometries
1660
+ // is the feature contained in the view extent ( mCachedGeometries) ?
1661
1661
QgsGeometryMap::iterator cachedIt = mCachedGeometries .find ( selectedFeatureId );
1662
1662
if ( cachedIt != mCachedGeometries .end () )
1663
1663
{
@@ -1669,6 +1669,23 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
1669
1669
}
1670
1670
return errorCode;
1671
1671
}
1672
+ else // maybe the selected feature has been moved outside the visible area and therefore is not contained in mCachedGeometries
1673
+ {
1674
+ QgsFeature f;
1675
+ QgsGeometry* fGeom = 0 ;
1676
+ if (featureAtId ( selectedFeatureId, f, true , false ))
1677
+ {
1678
+ fGeom = f.geometryAndOwnership ();
1679
+ if (fGeom )
1680
+ {
1681
+ int errorCode = fGeom ->addIsland (ring);
1682
+ mChangedGeometries .insert ( selectedFeatureId, *fGeom );
1683
+ setModified ( true , true );
1684
+ delete fGeom ;
1685
+ return errorCode;
1686
+ }
1687
+ }
1688
+ }
1672
1689
1673
1690
return 6 ; // geometry not found
1674
1691
}
You can’t perform that action at this time.
0 commit comments