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