From 33841eb827045002a5fa3e82cde7ecccb9e67cdb Mon Sep 17 00:00:00 2001 From: Thomas Gimpel Date: Tue, 30 Jun 2020 23:08:35 +0200 Subject: [PATCH] Sketcher: fix crash, when cloning element having a non-driving distance, radius, diameter or angle constraint; fixes #4393 --- src/Mod/Sketcher/App/SketchObject.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index d07bf24430..038847366d 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -3939,6 +3939,7 @@ int SketchObject::addCopy(const std::vector &geoIdList, const Base::Vector3 // Distances on a single Element are mapped to equality constraints in clone mode Constraint *constNew = (*it)->copy(); constNew->Type = Sketcher::Equal; + constNew->isDriving = true; constNew->Second = geoIdMap[(*it)->First]; // first is already (*it->First) newconstrVals.push_back(constNew); } @@ -3946,6 +3947,7 @@ int SketchObject::addCopy(const std::vector &geoIdList, const Base::Vector3 // Angles on a single Element are mapped to parallel constraints in clone mode Constraint *constNew = (*it)->copy(); constNew->Type = Sketcher::Parallel; + constNew->isDriving = true; constNew->Second = geoIdMap[(*it)->First]; // first is already (*it->First) newconstrVals.push_back(constNew); } @@ -3968,6 +3970,7 @@ int SketchObject::addCopy(const std::vector &geoIdList, const Base::Vector3 // Distances on a two Elements, which must be points of the same line are mapped to equality constraints in clone mode Constraint *constNew = (*it)->copy(); constNew->Type = Sketcher::Equal; + constNew->isDriving = true; constNew->FirstPos = Sketcher::none; constNew->Second = geoIdMap[(*it)->First]; // first is already (*it->First) constNew->SecondPos = Sketcher::none;