Sketcher: Fixed setPathValue to convert angles to radians before they are stored in the Constraint object. This mimics the setDatum implementation.
This commit is contained in:
parent
24c60199cc
commit
db2f868bbe
|
@ -32,6 +32,7 @@
|
||||||
#include <Base/Exception.h>
|
#include <Base/Exception.h>
|
||||||
#include <Base/Reader.h>
|
#include <Base/Reader.h>
|
||||||
#include <Base/Writer.h>
|
#include <Base/Writer.h>
|
||||||
|
#include <Base/Tools.h>
|
||||||
#include <App/ObjectIdentifier.h>
|
#include <App/ObjectIdentifier.h>
|
||||||
#include <App/DocumentObject.h>
|
#include <App/DocumentObject.h>
|
||||||
|
|
||||||
|
@ -423,6 +424,13 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo
|
||||||
if (c0.isArray() && path.numSubComponents() == 1) {
|
if (c0.isArray() && path.numSubComponents() == 1) {
|
||||||
if (c0.getIndex() >= _lValueList.size())
|
if (c0.getIndex() >= _lValueList.size())
|
||||||
throw Base::Exception("Array out of bounds");
|
throw Base::Exception("Array out of bounds");
|
||||||
|
switch (_lValueList[c0.getIndex()]->Type) {
|
||||||
|
case Angle:
|
||||||
|
dvalue = Base::toRadians<double>(dvalue);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
aboutToSetValue();
|
aboutToSetValue();
|
||||||
_lValueList[c0.getIndex()]->setValue(dvalue);
|
_lValueList[c0.getIndex()]->setValue(dvalue);
|
||||||
hasSetValue();
|
hasSetValue();
|
||||||
|
@ -433,6 +441,13 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo
|
||||||
|
|
||||||
for (std::vector<Constraint *>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
|
for (std::vector<Constraint *>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
|
||||||
if ((*it)->Name == c1.getName()) {
|
if ((*it)->Name == c1.getName()) {
|
||||||
|
switch (_lValueList[c0.getIndex()]->Type) {
|
||||||
|
case Angle:
|
||||||
|
dvalue = Base::toRadians<double>(dvalue);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
aboutToSetValue();
|
aboutToSetValue();
|
||||||
_lValueList[it - _lValueList.begin()]->setValue(dvalue);
|
_lValueList[it - _lValueList.begin()]->setValue(dvalue);
|
||||||
hasSetValue();
|
hasSetValue();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user