+ fixes #0001790: Crash on undo/redo with a selection

This commit is contained in:
wmayer 2014-12-14 00:06:08 +01:00
parent ff7e33b95d
commit 78f07f8731

View File

@ -1957,22 +1957,29 @@ void ViewProviderSketch::updateColor(void)
//int32_t *index = edit->CurveSet->numVertices.startEditing();
// colors of the point set
if (edit->FullyConstrained)
if (edit->FullyConstrained) {
for (int i=0; i < PtNum; i++)
pcolor[i] = FullyConstrainedColor;
else
}
else {
for (int i=0; i < PtNum; i++)
pcolor[i] = VertexColor;
}
if (edit->PreselectCross == 0)
if (edit->PreselectCross == 0) {
pcolor[0] = PreselectColor;
else if (edit->PreselectPoint != -1)
}
else if (edit->PreselectPoint != -1) {
if (edit->PreselectPoint + 1 < PtNum)
pcolor[edit->PreselectPoint + 1] = PreselectColor;
}
for (std::set<int>::iterator it=edit->SelPointSet.begin();
it != edit->SelPointSet.end(); it++)
pcolor[*it] = (*it==(edit->PreselectPoint + 1) && (edit->PreselectPoint != -1))?
PreselectSelectedColor:SelectColor;
for (std::set<int>::iterator it = edit->SelPointSet.begin(); it != edit->SelPointSet.end(); ++it) {
if (*it < PtNum) {
pcolor[*it] = (*it==(edit->PreselectPoint + 1) && (edit->PreselectPoint != -1))
? PreselectSelectedColor : SelectColor;
}
}
// colors of the curves
//int intGeoCount = getSketchObject()->getHighestCurveIndex() + 1;