Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Sketcher: Fixed radian/degree mix-up for Angle constraint.
  • Loading branch information
eivindkv authored and wwmayer committed Jun 18, 2016
1 parent 0c449d7 commit acfe417
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Sketcher/App/Constraint.cpp
Expand Up @@ -28,6 +28,7 @@

#include <Base/Writer.h>
#include <Base/Reader.h>
#include <Base/Tools.h>
#include <QDateTime>

#include "Constraint.h"
Expand Down Expand Up @@ -145,6 +146,7 @@ double Constraint::getPresentationValue() const
else
return Value;
case Angle:
return Base::toDegrees<double>(Value);
case SnellsLaw:
return Value;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp
Expand Up @@ -135,7 +135,7 @@ class ConstraintItem : public QListWidgetItem
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();
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -3824,7 +3824,7 @@ void ViewProviderSketch::draw(bool temp)
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;
Expand Down

0 comments on commit acfe417

Please sign in to comment.