Sketcher: Fixed radian/degree mix-up for Angle constraint.

This commit is contained in:
Eivind Kvedalen
2016-06-18 10:28:34 +02:00
committed by wmayer
parent 0c449d7e8f
commit acfe41706c
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -28,6 +28,7 @@
#include <Base/Writer.h>
#include <Base/Reader.h>
#include <Base/Tools.h>
#include <QDateTime>
#include "Constraint.h"
@@ -145,6 +146,7 @@ double Constraint::getPresentationValue() const
else
return Value;
case Angle:
return Base::toDegrees<double>(Value);
case SnellsLaw:
return Value;
default:
@@ -135,7 +135,7 @@ public:
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(constraint->getPresentationValue(),Base::Unit::Length).getUserString());
break;
case Sketcher::Angle:
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(Base::toDegrees<double>(constraint->getPresentationValue()),Base::Unit::Angle).getUserString());
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(constraint->getPresentationValue(),Base::Unit::Angle).getUserString());
break;
case Sketcher::SnellsLaw: {
double v = constraint->getPresentationValue();
+1 -1
View File
@@ -3824,7 +3824,7 @@ Restart:
break;
SoDatumLabel *asciiText = dynamic_cast<SoDatumLabel *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL));
asciiText->string = SbString(Base::Quantity(Base::toDegrees<double>(Constr->getPresentationValue()),Base::Unit::Angle).getUserString().toUtf8().constData());
asciiText->string = SbString(Base::Quantity(Constr->getPresentationValue(),Base::Unit::Angle).getUserString().toUtf8().constData());
asciiText->datumtype = SoDatumLabel::ANGLE;
asciiText->param1 = Constr->LabelDistance;
asciiText->param2 = startangle;