diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index 375927cfac..cfd1b85a51 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -704,7 +704,7 @@ const boost::any PropertyPlacement::getPathValue(const ObjectIdentifier &path) c if (p == ".Rotation.Angle") { // Convert angle to degrees - return Base::Quantity(Base::toDegrees(boost::any_cast(Property::getPathValue(path))), Unit::Angle); + return Base::Quantity(Base::toDegrees(boost::any_cast(Property::getPathValue(path))), Unit::Angle); } else if (p == ".Base.x" || p == ".Base.y" || p == ".Base.z") { // Convert double to quantity diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 7550911257..70866b94d5 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -400,6 +401,7 @@ void Gui::QuantitySpinBox::onChange() bool QuantitySpinBox::apply(const std::string & propName) { if (!ExpressionBinding::apply(propName)) { + double dValue = value().getValue(); if (isBound()) { const App::ObjectIdentifier & path = getPath(); const Property * prop = path.getProperty(); @@ -407,8 +409,16 @@ bool QuantitySpinBox::apply(const std::string & propName) /* Skip update if property is bound and we know it is read-only */ if (prop && prop->isReadOnly()) return true; + + if (prop && prop->getTypeId().isDerivedFrom(App::PropertyPlacement::getClassTypeId())) { + std::string p = path.getSubPathStr(); + if (p == ".Rotation.Angle") { + dValue = Base::toRadians(dValue); + } + } } - Gui::Command::doCommand(Gui::Command::Doc, "%s = %f", propName.c_str(), value().getValue()); + + Gui::Command::doCommand(Gui::Command::Doc, "%s = %f", propName.c_str(), dValue); return true; } else