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

This commit is contained in:
Eivind Kvedalen 2016-06-13 20:27:48 +02:00 committed by wmayer
parent 75240e0058
commit 171fce7b19
3 changed files with 4 additions and 2 deletions

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:

View File

@ -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();

View File

@ -3825,7 +3825,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;