Sketcher: Fixed keeping sign of constraints.

This commit is contained in:
Eivind Kvedalen
2015-10-05 00:02:41 +02:00
committed by wmayer
parent 51e4eebbc6
commit 208ba9eb9d
5 changed files with 18 additions and 11 deletions

View File

@@ -3524,9 +3524,9 @@ Restart:
if ((Constr->Type == DistanceX || Constr->Type == DistanceY) &&
Constr->FirstPos != Sketcher::none && Constr->Second == Constraint::GeoUndef)
// display negative sign for absolute coordinates
asciiText->string = SbString(Base::Quantity(Constr->getValue(),Base::Unit::Length).getUserString().toUtf8().constData());
asciiText->string = SbString(Base::Quantity(Constr->getPresentationValue(),Base::Unit::Length).getUserString().toUtf8().constData());
else // hide negative sign
asciiText->string = SbString(Base::Quantity(std::abs(Constr->getValue()),Base::Unit::Length).getUserString().toUtf8().constData());
asciiText->string = SbString(Base::Quantity(std::abs(Constr->getPresentationValue()),Base::Unit::Length).getUserString().toUtf8().constData());
if (Constr->Type == Distance)
asciiText->datumtype = SoDatumLabel::DISTANCE;
@@ -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>(std::abs(Constr->getValue())),Base::Unit::Angle).getUserString().toUtf8().constData());
asciiText->string = SbString(Base::Quantity(Base::toDegrees<double>(std::abs(Constr->getPresentationValue())),Base::Unit::Angle).getUserString().toUtf8().constData());
asciiText->datumtype = SoDatumLabel::ANGLE;
asciiText->param1 = Constr->LabelDistance;
asciiText->param2 = startangle;
@@ -3879,7 +3879,7 @@ Restart:
SbVec3f p2(pnt2.x,pnt2.y,zConstr);
SoDatumLabel *asciiText = dynamic_cast<SoDatumLabel *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL));
asciiText->string = SbString(Base::Quantity(Constr->getValue(),Base::Unit::Length).getUserString().toUtf8().constData());
asciiText->string = SbString(Base::Quantity(Constr->getPresentationValue(),Base::Unit::Length).getUserString().toUtf8().constData());
asciiText->datumtype = SoDatumLabel::RADIUS;
asciiText->param1 = Constr->LabelDistance;