From db2f868bbe07e9f764bdffcba1daf5d4c5ff7b4e Mon Sep 17 00:00:00 2001 From: Eivind Kvedalen Date: Thu, 10 Dec 2015 20:50:48 +0100 Subject: [PATCH] Sketcher: Fixed setPathValue to convert angles to radians before they are stored in the Constraint object. This mimics the setDatum implementation. --- src/Mod/Sketcher/App/PropertyConstraintList.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.cpp b/src/Mod/Sketcher/App/PropertyConstraintList.cpp index 0743e6796e41..d270add339fe 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.cpp +++ b/src/Mod/Sketcher/App/PropertyConstraintList.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -423,6 +424,13 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo if (c0.isArray() && path.numSubComponents() == 1) { if (c0.getIndex() >= _lValueList.size()) throw Base::Exception("Array out of bounds"); + switch (_lValueList[c0.getIndex()]->Type) { + case Angle: + dvalue = Base::toRadians(dvalue); + break; + default: + break; + } aboutToSetValue(); _lValueList[c0.getIndex()]->setValue(dvalue); hasSetValue(); @@ -433,6 +441,13 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo for (std::vector::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { if ((*it)->Name == c1.getName()) { + switch (_lValueList[c0.getIndex()]->Type) { + case Angle: + dvalue = Base::toRadians(dvalue); + break; + default: + break; + } aboutToSetValue(); _lValueList[it - _lValueList.begin()]->setValue(dvalue); hasSetValue();