[Sketcher] Safeguard against spurious pre-selection
Preselection is sometimes not updated under some circumstances 1. when deleting an object through python; 2. before autoconstraint when deleting previous pole in bspline creation mode. When the preselected curve is the deleted object, segfault/crash can happen.
This commit is contained in:
committed by
abdullahtahiriyo
parent
3fa1735088
commit
f10ccfc0fb
@@ -303,7 +303,9 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade & geol
|
||||
}
|
||||
else if (preselectpoint != -1) {
|
||||
preselectpointmfid = coinMapping.getIndexLayer(preselectpoint);
|
||||
if (l == preselectpointmfid.layerId && preselectpointmfid.fieldIndex < PtNum)
|
||||
if (MultiFieldId::Invalid != preselectpointmfid &&
|
||||
preselectpointmfid.layerId == l &&
|
||||
preselectpointmfid.fieldIndex < PtNum)
|
||||
pcolor[preselectpointmfid.fieldIndex] = drawingParameters.PreselectColor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user