Sketcher: Extend distance constraint to arcs

This commit is contained in:
Florian Foinant-Willig
2023-09-03 22:29:27 +02:00
committed by abdullahtahiriyo
parent 94eaa7db78
commit d2a579bdc6
4 changed files with 86 additions and 39 deletions

View File

@@ -445,9 +445,12 @@ int SketchObject::setDatum(int ConstrId, double Datum)
if (!vals[ConstrId]->isDimensional() && type != Tangent && type != Perpendicular)
return -1;
if ((type == Distance || type == Radius || type == Diameter || type == Weight) && Datum <= 0)
if ((type == Radius || type == Diameter || type == Weight) && Datum <= 0)
return (Datum == 0) ? -5 : -4;
if (type == Distance && Datum == 0)
return -5;
// copy the list
std::vector<Constraint*> newVals(vals);
double oldDatum = newVals[ConstrId]->getValue();